Ted Cruz has never run for office before. The 41-year-old beat Texas Lt. Gov. David Dewhurst in a Senate runoff last night not only thanks to some powerful friends but on the strength of his impressive biography.

View Photo Gallery: Five things you didn’t know about Ted Cruz: A closer look at Texas’s Republican nominee for U.S. Senate in November.

Cruz was born Rafael Cruz in Canada, where his Cuban father and Irish-American mother had moved for the 1960s oil boom. They had met at an oil exploration business in Texas.

As a teenager, his father fought for Fidel Castro against Fulgencio Batista. “They didn’t know Castro was a Communist, what they knew was that Batista was a cruel and oppressive dictator,” Cruz said earlier this year.

After being imprisoned and tortured by the Batista regime, the elder Rafael Cruz came to America on a student visa with nothing but $100 sewn into his underwear. He made his way through the University of Texas by washing dishes.

Eleanor Darragh, Cruz’s mother, was a working-class Delaware native who studied math at Rice University. Cruz once told a tea party group that his mother refused to learn how to type, so that when men asked her to type things up for her she could say, “I would love to help you out, but I don’t know how to type. I guess you’re going to have to use me as a computer programmer instead.”

Cruz was raised in Houston (all he remembers about Canada: “It was cold.”) In high school he was part of a group sponsored by the Free Enterprise Institute that learned the Constitution by heart and traveled the state giving speeches on conservative ideas.

At Princeton he was a champion debater. From there he went to Harvard Law School. “Cruz was off-the-charts brilliant,” Prof. Alan Dershowitz told the National Review. Cruz was a founding editor of the Harvard Latino Law Review.

After law school, Cruz clerked for Judge J. Michael Luttig on the Fourth Circuit of the U.S. Court of Appeals. In 1996, he became Chief Justice William H. Rehnquist’s first Hispanic clerk.

After a few years in private practice, Cruz met Josh Bolten, George W. Bush’s campaign policy director and another Princeton alum. He became a domestic policy adviser to Bush during the 2000 Bush-Cheney campaign. There he met his wife, Heidi Nelson Cruz, another policy adviser. She now works for Goldman Sachs.

When the election ended in a recount, they both went to Florida to work for Bush’s team, and the experience helped them both get jobs in government. Cruz served as assistant attorney general in the Justice Department and director of policy planning at the Federal Trade Commission.

In 2003, Cruz was appointed solicitor general and returned to Texas. In his five years in the post, he wrote 70 briefs to the Supreme Court and argued before the court nine times. He was involved in numerous high-profile cases, including defending the Ten Commandments monument on the Texas State Capitol grounds, the recitation of the Pledge of Allegiance in public schools and the 2003 Texas redistricting plan.

He says he’s proudest of his work in Medillin v. Texas, in which the state fought the Bush administration over the execution of a Mexican citizen.

From there he worked in private practice for Morgan Lewis, where he defended some corporate interests that Dewhurst used (unsuccessfully) in attack ads.

Cruz originally planned to run for attorney general in 2010, but changed his mind when his old boss decided to stay in the job. “I know that attorney general is ultimately his goal,” a source told the Observer in April. “It’s his dream ticket. I think he sees the Senate race as his path to where he needs to be.” In that sense, he succeeded.