A courtroom sketch shows Solicitor General Donald Verrilli arguing before the Supreme Court on April 25, 2012.Dana Verkouteren / AP

Solicitor General Donald Verrilli, who serves as the Obama administration’s top lawyer in Supreme Court cases, will step down on June 24.

Verrilli’s five-year term as solicitor general is one of the longest in history, and easily the longest in recent memory. It was also an unusually prominent run, as Verrilli argued several landmark cases before the Supreme Court. As solicitor general, Verrilli argued the winning side in defending the Affordable Care Act, challenging a harsh Arizona immigration law, and making marriage equality the law of the land.

Those victories came despite widely panned performances in court. The mustachioed Verrilli was especially derided for his defense of the Affordable Care Act in NFIB v. Sebelius, the 2012 case that was the first and gravest threat to Obamacare. Legal experts initially dismissed the challenge as fanciful, but it made its way through the courts to the Supreme Court. As solicitor general, it was Verrilli’s job to defend the law against a challenge argued by Paul Clement, a conservative widely considered one of the nation’s best litigators.

After oral arguments, it seemed that the Cinderella challenge might succeed. Commentators viewed the government’s defense as meandering, bumbling, and inarticulate. “Obama's Lawyer Had A Meltdown Just 25 Seconds Into His Supreme Court Argument Today,” Business Insider hooted. “Donald Verrilli Makes the Worst Supreme Court Argument of All Time,” groaned Kevin Drum, while his colleague Adam Serwer speculated it was “one of the most spectacular flameouts in the history of the court.” Most famously, Jeffrey Toobin of CNN and The New Yorker  declared, “This still looks like a train wreck for the Obama Administration, and it may also be a plane wreck. This entire law is now in serious trouble.” (Other analysts were more measured.)

But when the ruling came down three months later, Verrilli had won. Writing for the Court, Chief Justice John Roberts upheld the law’s individual mandate as a tax—an argument that Verrilli had pursued, over the objection of some of his White House colleagues. “This is a day for Don Verilli to take an enormous amount of credit and for me to eat a bit of crow,” Toobin gamely admitted.

It was sweet vindication for Verrilli, a man who was familiar with the underdog role. Verrilli, despite a prestigious resume in the private sector, including clerking for Justice William Brennan and arguing several times before the high court, was a great admirer of Barack Obama and desperate to work in his administration after the 2008 election. How desperate?

“I would have taken any job, including sweeping the floors, to work in the Department of Justice,” he said. “The reason I felt that way was I settled in Washington in the 1980s because I wanted to do public service. And I woke up 25 years later not having done that, and so I thought the time had come.”

As Nina Totenberg wrote, the job he took—associate deputy attorney general—seemed to many colleagues too lowly for a man of his stature and career. But Verrilli jumped into the job. In February 2010, he moved to the White House Counsel’s office, where he forged a tight bond with the president. About a year later, Obama nominated Verrilli to replace Elena Kagan, who had joined the Supreme Court. The man who was willing to sweep floors now occupied one of the nation’s most prestigious legal posts.

Verrilli also defeated a later challenge to the ACA, among other accomplishments. His record was not without blemishes, however, particular the Court’s decision in Shelby County v. Holder, in which the justices struck down key portions of the Voting Rights Act. Verrilli could be self-critical, too, deciding after his first year on the job that he had been too deferential to the justices, and adopting a more aggressive approach. He was self-deprecating about his arguments, too. “Let me just say on that point that people who say there’s no such thing as bad publicity have no idea what they’re talking about,” he said in a Columbia Law School commencement address. “There is definitely bad publicity. Being on the wrong end of a Jon Stewart monologue is bad publicity.”

In a statement Thursday, Obama praised Verrilli:

Thanks to his efforts, 20 million more Americans now know the security of quality, affordable health care; we’re combatting discrimination so that more women and minorities can own their piece of the American Dream; we’ve reaffirmed our commitment to ensuring that immigrants are treated fairly; and our children will now grow up in a country where everyone has the freedom to marry the person they love.

Verrilli’s replacement will be Ian Gershengorn, who is currently his principal deputy. A graduate of Harvard Law School, Gershengorn clerked for Justice John Paul Stevens, worked in private practice, and served in the Clinton administration, where he helped vet then-Judge Stephen Breyer for a Supreme Court vacancy. Gershengorn was skeptical, saying Breyer was a “rather cold fish” and unlikely to be “a great Supreme Court justice.” Luckily for Gershengorn, and for the Obama administration’s chances before the Court, Breyer has forgiven him.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.