Michael Kruse is a senior staff writer for Politico.

In 2008, in the high-profile Supreme Court gun-rights case called District of Columbia v. Heller, a brief was filed from the eighth floor of the Price Daniel Sr. State Office Building in Austin, Texas, specifically from the corner office of the man who was then the state’s solicitor general, Ted Cruz.

The brief took a strong stance on the divisive question of whether the Second Amendment establishes an individual right to own guns, or just protects state and local militias. The brief argued forcefully for the first view, writing that “the individual right to keep and bear arms” is a “fundamental right” and that “an individual right that can be altogether abrogated is no right at all.” Thirty attorneys general from other states signed on.


Today, with the White House pushing new gun restrictions and Cruz's candidacy riding on next month's Iowa caucuses, it's no surprise that the Texas Republican would embrace gun rights as a defining issue, holding an event at a firing range and even raffling off an engraved 12-gauge shotgun as a campaign promotion.

In 2008, the situation was very different: he was wading into a case that had no immediate connection to Texas at all. But to see the signature of R. Ted Cruz on the brief would not have surprised the nine Supreme Court justices in the least. By that time, Cruz had been solicitor general for five years, and inserting himself into a case of wide prominence and importance regardless of any direct tie to Texas had become part of his playbook. He clearly saw the Heller case as a watershed in gun rights, writing that it would “determine whether the Second Amendment has any modern relevance.” And he was right. The Supreme Court in a 5-4 decision shot down the Washington, D.C., handgun ban and ruled for the first time in the history of this country that the amendment ensures an individual person’s right to have a gun for self-defense. The National Rifle Association recognized Cruz’s role with a resolution.

As Cruz climbs to the top of the Republican presidential field, the five-plus years he served as the solicitor general of Texas remain the most important period in his public résumé. They’re the record he ran on when he was elected to the U.S. Senate in 2012—and they represent significantly more of his working life than the three years he has served so far in the Senate. They're also a prime source of fodder for liberal and moderate critics, should be become the Republican presidential nominee.

A Politico review of Cruz’s record as solicitor general shows he used the role in a new and far more ideological way than his predecessors, taking a relatively low-profile job that had traditionally been used mostly to defend the state government and turning it into a stage for pushing national conservative causes. Cruz argued eight cases in front of the U.S. Supreme Court—far more than his predecessors and successors—using each of them to advance a position endorsed by conservative thinkers. He also was the counsel of record on some 70 friend-of-the-court briefs, or amicus briefs, weighing in on cases across the country, like Heller, in which Texas had no direct stake, but which similarly offered a chance to argue ideological points.

He really turned the office into a platform.”

“He really turned the office into a platform,” David Bernstein, a George Mason law professor who recently wrote a book about the Obama administration for which Cruz wrote the foreword, said in an interview.

“He built up the national aura of the office,” said Tom Phillips, who was the chief justice of the Supreme Court of Texas at the start of Cruz’s run as solicitor general.

Cruz’s zealous work served the ambitions of the conservative movement, but he also personally used it to build a bridge between what he was (an elite constitutional law nerd) to what he is today (an ascendant right-wing politician). Yet while pleasing to conservatives, other aspects of his record are sure to attract critics. He argued against leniency for an unjustly sentenced man whose lawyer had made a technical mistake; he invoked 13th-century “Saxon law” and the practice of cutting off testicles to justify harsher punishments in a rape case; and he referred to a late-term abortion technique as “infanticide.”

Although little examined in the race so far, Cruz’s time as solicitor general built him a powerful allegiance among the conservative donors necessary to launch a national campaign. Heading into Iowa, New Hampshire, South Carolina and beyond, he has more money at his disposal than any candidate besides Jeb Bush. And the way he used that Texas office is part of the reason. Toby Neugebauer, who wrote a $10 million check to the Cruz super PAC called Keep the Promise II, told me the reason he did that—the single reason—is what Cruz did as solicitor general. He said other major donors feel the same way.

“We’re backing someone,” Neugebauer told me, “that had a worldview and went out and executed on it.”

***

Cruz took the solicitor job as a reboot of sorts after his initial foray into politics had fizzled.

As a debater at Princeton, as a law school student at Harvard, and as a clerk to then-Supreme Court Chief Justice William Rehnquist, Cruz was widely considered brilliant—but he left his first real job as a promising appellate attorney in private practice in Washington to instead toil in 2000 as a domestic policy analyst in George W. Bush’s presidential campaign, then as a legal hand for Bush’s team in the frantic recount in Florida that ultimately won Bush the election.

In return, Cruz “desperately” wanted “a senior post” in the White House, he wrote in his autobiography. On the campaign, though, he had earned a reputation for his outsized ego as much as for his obvious intelligence, and the post-election jobs he got were out-of-the-way roles at the Department of Justice and the Federal Trade Commission. “I just don’t like the guy,” Bush has said since. The solicitor general role in his home state of Texas, offered to him by Greg Abbott—then the attorney general of Texas, now the governor—was a political lifeline.

From the start, it offered a chance to turn his legal acumen into political potential, because it came with a green light to advance conservative aims in the courts. Abbott’s directive for the solicitor general of Texas, Cruz said in his book, was to “look across the country” and “identify chances to defend conservative principles.”

This is not the traditional definition of a solicitor general’s job, which comes with two main duties. The first: States get sued, attorneys general and their staffs respond, and some of the cases get appealed—and that’s where the solicitor general comes in, representing the state in higher courts, where the cases are the most legalistic and complex. The second: the writing of amicus briefs in cases elsewhere in which a state believes it has an interest even though it’s not a party.

The first part can be seen as defense. The second part is more like offense, selectively advancing the interests of the state. The way Cruz did the job? Even the defense was offense, and the interests being asserted were less those of the state than its conservative leaders.

“Texas is a huge state, and there’s plenty of work for the attorney general’s office to do,” said Jim Ho, an attorney in Dallas who succeeded Cruz as solicitor general and is a friend and supporter. Cruz, though, “was not content to simply do what was asked and go home.”

When it came to cases that allowed him to argue for things like the forceful application of the death penalty and expressions of religion in the public arena and against things like abortion and gun control, Ho told me, Cruz “was on constant watch for opportunities to press a conservative vision of the Constitution.”

One person with intimate knowledge of the office described Cruz to me as a “show horse.” Others told me Cruz simply was discerning and strategic and had no qualms about delegating. “My understanding is he gave people a lot of responsibility and trusted his assistants,” said Aaron Streett, an attorney in Houston who counts himself as a Cruz supporter. Cruz, meanwhile, compared with his predecessors, ratcheted up the writing of amicus briefs. And of the cases to which he or the more than a dozen attorneys who worked for him had to respond, he tended to prioritize those he felt would have the most impact, the most buzz, the best shot at ending up in front of the Supreme Court.

The first high-profile case along these lines—and often the first on a list that Cruz hits in speeches—was Van Orden v. Perry, one of a handful of key fights around the country over whether a public institution can display the Ten Commandments.

A homeless former lawyer named Thomas Van Orden sued Texas on account of a Ten Commandments monument on the capitol grounds in Austin. His contention was that this was an unconstitutional injection of religion into such a shared public space. Cruz fought him up the chain of courts. After the case, in interviews with reporters, at forums at conservative think tanks and in an appearance in a short documentary about the case made by the law school at Duke, Cruz painted the case as a pivotal battle against godless liberals who seek to rub out what he sees as religion’s rightful role in American culture. He said in a panel discussion at the Heritage Foundation that Van Orden was “a significant victory from the perspective of keeping away the chisels and sandblasters.” He fretted in the Dallas Morning News about efforts to “read into our Constitution a hostility toward religion.” Besides, he said in the Duke documentary, “nobody is forcing the passerby to confront this. If an individual is offended, don’t look at it.”

When the case went to the Supreme Court in 2005, it was Abbott, not Cruz, who argued on behalf of Texas—even though Cruz had argued in front of the appeals court in New Orleans, and Erwin Chemerinsky, who argued on behalf of Van Orden, told me he had dealt with Cruz almost exclusively throughout the case. In a 5-4 decision, the Supreme Court sided with Texas—with Cruz—saying it was OK to have a Ten Commandments monument on the state’s capitol grounds.

In eight other cases, though, as solicitor general, Cruz gave oral arguments himself at the Supreme Court. Not all of them were wins, but all were chances for Cruz to showcase his particular brand of vigorously argued movement conservatism.

In 2003, in Frew v. Hawkins, his first appearance, Cruz argued that Texas shouldn’t have to pay more for health care for poor kids in the state even though the state had consented to a federal decree. It was a loser, and even a gifted debater like Ted Cruz couldn’t persuade the justices that it was worth their time. “What is the purpose of this exercise?” Justice Stephen Breyer asked Cruz at one point. The nine justices ruled unanimously against Cruz.

In 2004, in Dretke v. Haley, Cruz argued against leniency for a man who had been unjustly sentenced for a series of thefts—basically because the man’s attorney hadn’t objected when he was supposed to. Cruz worried it would set a bad precedent if the Supreme Court essentially let him out. He faced withering skepticism for putting the principle ahead of the case itself. “So a man does 15 years so you can vindicate your legal point in some other case?” Justice Anthony Kennedy said to Cruz. The justices kicked the case back to Texas courts, which ultimately resentenced the man to the time he had already served.

Losers though the cases were, the big ideas inside them—holding the line on health care costs, federal overreach, and states’ rights; sending a tough-on-crime message—were quickly helping Cruz build a record as an advocate totally committed to helping lay solid legal foundations beneath popular conservative talking points.

***

But the case Ted Cruz talks about the most is Medellin v. Texas. In 2005 and again in 2007, Cruz was put in the intriguing position of, in essence, going up against President George W. Bush. The specifics were compelling: Jose Medellin, a Mexican citizen who had grown up in Texas, raped and killed two teenage girls in Houston. His appeal centered on the fact that he hadn’t been given the chance to talk to the Mexican consulate, violating an international treaty. The International Court of Justice ordered a retrial, not just for Medellin but 50 other Mexican citizens with similar situations. Bush, stunning Cruz and others, penned an executive memorandum siding with the court.

Cruz argued in front of the Supreme Court that the president had overreached. The case, he said, was a question of U.S. sovereignty and of the foundational issue of separation of powers. The president, Cruz said, did not have the power to do what he did. No president would. Not in this country. Cruz, in polite understatement, called it “a very curious assertion of presidential power.” There were six reasons for that, Cruz told the nine justices, and he started his run-down, and some justices began to break in with questions. Cruz must have known, though, that his argument was going well when Justice John Paul Stevens said, “I really would like to hear what those reasons are without interruption from all of my colleagues.”

The court ruled 6-3 for Texas in June 2005. Medellin was executed a little more than three years later.

Cruz had four other oral arguments in front of the Supreme Court. In League of United Latin American Citizens v. Perry in 2006, he emphasized the importance of separation of powers in defending a congressional redistricting case that made Texas a friendlier state in which to run for Republicans. In Smith v. Texas and Panetti v. Quarterman in 2007 and Kennedy v. Louisiana in 2008, he argued pro-death-penalty positions in one case in which the defendant was borderline insane, and another in which the defendant had raped but not killed an 8-year-old girl.

With respect to Scott Panetti, a schizophrenic who suffered from delusions and hallucinations, Cruz argued in court that he was fit to be executed because “he knows that he murdered two people” and “he understands that he is going to be put to death.”

In Kennedy, Cruz argued, “Few evolving standards of decency are more pronounced than the growing understanding in modern society of the unique and irreparable harm caused by violent child rape.”

Kennedy was noteworthy, too, partly because the attorney for Louisiana chose to share her argument time with Cruz and the justices approved that. It was a sign of his growing stature at the Supreme Court, and of his confidence. Any kind of joke is a risk in oral arguments in front of the Supreme Court, but at one point in his Kennedy argument, in one of his most out-there rhetorical flights, Cruz invoked Saxon law in 13th-century England, where the punishment for rape “was relaxed to loss of the eyes and testicles.” He added, “That was William the Conqueror’s kinder, gentler version.” A smattering of laughter rippled through the courtroom.

Cruz was emerging as a legal ideologue, but he wasn’t just an ideologue. In speaking to people who argued against Cruz in the Supreme Court, or who watched Cruz argue there, or who just watched him in practice arguments, called moot courts, at various law schools, I found a dominant recurring theme: He was really, really good, and he got better as time went on. Even in his 30s, they said, Cruz was in a very small group of the best appellate attorneys and oral advocates who were Supreme Court “repeat players.”

“Very articulate, very smart,” said Susan Zinn, an attorney in San Antonio, who argued the other side in Frew. “Incredibly smart, incredibly talented,” said Jeff Fisher, now a law professor at Stanford, who argued the other side in Kennedy. “Gifted,” said Richard Lazarus, a law professor at Harvard, who, when he was at Georgetown, saw Cruz do a moot court there.

His only ding on Cruz: “Supreme Court argument is more persuasion than argument. They’re not just the best arguers. They’re the best persuaders.” At the time, Lazarus thought, Cruz was more an arguer than a persuader.

Despite the political brand he would later build as an outsider to Washington, Cruz was in his element at the Supreme Court in part because he had spent so much time there. Cruz had clerked at the court, in 1996, for Rehnquist. He had played pickup basketball games at the court’s upstairs gym. (One participant of those games told me that Cruz had a fairly decent midrange jump shot but that his specialty was the offensive charge.)

He had gone to apartment get-togethers with his fellow Ivy League-educated clerks. (Not that he let himself totally relax: He was the one who talked about the law even at those more informal gatherings, laying out his opinions, rattling off point after point, when the others were content to drink some beers and smoke cigars.) By the time he started appearing in front of the Supreme Court in his role as solicitor general, he wasn’t cowed by the august setting, the high ceiling with the gold trim, the smaller-than-expected courtroom, the podium that puts attorneys so close to the justices they have to look up at them. He had studied the institution, and he knew all the justices—and just as importantly, Fisher told me, “they knew who he was.”

***

The even more telling portion of what he did as solicitor general is the amicus briefs. Because some of the cases for which he did those eight oral arguments were better than others—Haley, for instance, probably will never be a part of any political pitch—and because even a smart, strategic, selective solicitor general has to work with the cases the courts put in front of him. The briefs, though? Cruz did them because he and Abbott wanted to.

They weren’t defense.

They were straight offense.

In a brief in Elk Grove v. Newdow, a case out of California, he argued that children in public schools should be able to say the words "under God" in the Pledge of Allegiance, citing “the undeniable link between our Nation and her religious foundation.”

In a brief in Lopez v. Gonzales, a case out of South Dakota, he wrote, “Our Nation must secure its borders, especially against convicted felons who enter illegally.”

In a brief in Ayotte v. Planned Parenthood of Northern New England, a case out of New Hampshire, he stressed the need for parental notification before abortion.

In a brief in Gonzales v. Carhart, a case that came through courts in California, Nebraska and New York, he argued for the defense of a federal law banning the procedure known by critics as "partial-birth abortions" because “they draw a bright line that clearly distinguishes between abortion and infanticide.”

And then there was what he wrote in his brief in District of Columbia v. Heller, the seminal Second Amendment case from 2008, when the Supreme Court held that the Second Amendment protects an individual right, as opposed to a collective, militia-related right, to have and use guns.

Every year from 2003 to 2007, Cruz was the counsel of record on briefs that won a Best Brief Award from the National Association of Attorneys Generals. He wasn’t the only winner—in 2007, for instance, NAAG gave a Best Brief Award to 17 people—but Cruz was a named winner five years in a row.

“He transformed how we engaged with the federal appellate process,” Chip Roy, Cruz’s former chief of staff, who now works in the Texas attorney general’s office, told me.

Around then, according to his book, Cruz had a four-hour breakfast with veteran Republican political strategist Karl Rove. “I asked his advice,” Cruz wrote, “on eventually running for office—whether I should stay on longer as solicitor general or go to private practice.” Rove, Cruz said, told him to keep doing what he was doing: “stay on the job as solicitor general, keep building my record, and find opportunities to systematically build political support for a future run.”

When Cruz left the solicitor general position, in 2009, to join the international law firm Morgan Lewis—now Morgan, Lewis & Bockius—Abbott praised him effusively.

“Ted Cruz has distinguished himself as one of the finest lawyers in the nation,” said Abbott, who declined to be interviewed for this story. “For more than five years, Ted has selflessly lent his tremendous legal ability to the state of Texas, successfully defending the Pledge of Allegiance, the Ten Commandments, the Second Amendment, civil commitment for violent sexual predators, and our great state’s sovereign independence from the World Court’s foreign judges. On behalf of all Texans, I thank Ted Cruz for his service to the state of Texas, and wish him well as he continues his extraordinary legal career.”

Looking back, reading Abbott’s standard-issue statement-speak, just one word sticks out. Legal. Because continuing his legal career was never really the goal. Cruz was going to run for office.

***

In the middle of his stretch as solicitor general, Cruz actually had been approached about becoming a judge on the U.S. Court of Appeals for the 5th Circuit, according to Don Willett, who worked with Cruz at the time and is now a justice of the Supreme Court of Texas. But Cruz didn’t want to do that, Willett told me, “because he believed his natural political home was the hurly-burly political branches, where fierce battles over ideas and convictions are waged—and where the national trajectory is set.” Judges “are not ideological combatants in the day-to-day political fray,” and that, Willett said, is what Cruz “longs for.”

He began running for attorney general in 2009—a logical next step—but then-Texas Senator Kay Bailey Hutchison didn’t resign her seat to run for governor, as everybody was expecting, which meant certain dominoes didn’t fall, leaving Abbott as attorney general. That left Cruz stuck at Morgan Lewis, which wasn’t the worst, considering he made more than a million dollars a year every year he was there, according to his financial disclosure forms. But still, Ed Burbach, who worked in the office next to Cruz when he was solicitor general, told me, “I don’t think Morgan Lewis was his goal.”

So in 2011, a year in which he made $1,573,543 from Morgan Lewis, he launched a long-shot run for the U.S. Senate, challenging in the Republican primary David Dewhurst, Texas’ well-known lieutenant governor.

That June, in New Orleans, in a Hilton ballroom at the annual Republican Leadership Conference, he made his pitch. He was polling at less than 10 percent. He told the small crowd about his record.

“During the five and a half years I served as solicitor general, over and over again, Texas stood up and led the nation defending conservative principles,” Cruz said. “We defended the Ten Commandments,” he said, not telling them that Abbott had been the one to actually argue in front of the Supreme Court. “We defended the Pledge of Allegiance,” not telling them that what he did was write an amicus brief. “We defended the Second Amendment,” he said, not telling them that what he did in the case, too, was write a brief. “We went to the Supreme Court, and we won,” he kept telling them, and they kept clapping, and the clapping was getting louder. He told them about Medellin. He told them all of this before he talked about his anti-Obamacare stance, before he told them about his family’s history, his father fleeing from Cuba and pursuing the American dream.

Two months later, in South Carolina at the RedState Bloggers Conference, it was the same: “Over and over again Texas stood up …”

“That’s the record I’m running on,” he told 70 people in folding chairs at a candidates forum put on by the Republican Women of Kerr County, Texas, that fall.

He chased down Dewhurst, getting enough votes in the primary to force a runoff. Still, the longtime politician pooh-poohed Cruz’s “record.”

“I’m not sure what you’ve done in the past is a record,” Dewhurst said in a debate in the summer of 2012. “And I know you’ve made your legal record the cornerstone of your campaign …”

Cruz likes to quote the ancient Chinese philosopher and general Sun Tzu. In 2014, in the New Yorker, he talked about winning a battle “by choosing the terrain on which it will be fought. So in litigation, I tried to ask, ‘What’s this case about?’ When the judge goes home and speaks to his or her grandchild, who’s in kindergarten, and the child says, ‘Paw-Paw, what did you do today?’—and if you own those two sentences that came out of the judge’s mouth, you win the case.”

And during his run for the U.S. Senate, throughout 2011 and 2012, putting the finishing touches on that bridge from elite legal nerd to right-wing politician, Cruz settled on his two sentences.

“I’m not running as a lawyer,” he said in a radio interview in San Antonio. “I’m running as a fighter.”