Chief Justice John G. Roberts Jr. (Andrew Harnik/AP)

President Obama and Chief Justice John G. Roberts Jr. got off to a rough start from the very beginning, when they tripped over each other’s words during a key line in the oath at Obama’s first inauguration.

Both Harvard Law School graduates, they occupy nearly opposite ends of the ideological spectrum. Obama, as a senator, had voted against Roberts’s confirmation to the court, saying the judge lacked sufficient empathy for the powerless and could not be counted on to vote the right way in the most important cases.

But in Thursday’s Supreme Court decision upholding federal subsidies offered under the Affordable Care Act, Roberts again helped sustain the president’s policy legacy in a way that few could have anticipated when Obama took office. In voting with the majority and writing the opinion, the chief justice has ensured that the legacies of both the Obama presidency and the Roberts court are forever intertwined.

Roberts on Thursday disappointed conservatives who hoped he would atone for 2012, when he saved Obamacare from an earlier constitutional challenge by providing the decisive vote. Instead, he doubled down, his tone deferential to an effort of the president and Congress that “grew out of a long history of failed health insurance reform.”

Roberts even brought along Justice Anthony M. Kennedy, who had agreed with the court’s three most conservative justices the first time around that the entire act should be junked as unconstitutional.

The Supreme Court upheld a key provision of the Affordable Care Act. Here's what it means for millions of Americans. (The Washington Post)

White House press secretary Josh Earnest said he would “reserve comment” on whether Obama had rethought his initial assessment of Roberts given the men’s “unique relationship.” But he added, “It seems like there are a lot of areas, at least with regard to this case, where the two men agree.”

But the decision was blasted by Roberts’s fellow conservatives, including Sen. Ted Cruz (R-Tex.), a presidential candidate who like Roberts had clerked for Chief Justice William H. Rehnquist.

“What this court has become is heartbreaking,” Cruz said. “If Chief Justice Rehnquist could see this court today, he would be filled with sorrow at what has become of the Supreme Court of the United States.”

If Roberts’s goal is to make the court appear nonpartisan, being scolded by the right in addition to the left might help.

But to Neal Katyal, who served as acting solicitor general during Obama’s first term, Thursday’s decision was proof that Roberts was sincere when he told the Senate during his confirmation hearing that he would serve as “an umpire” whose job was “to call balls and strikes and not to pitch or bat.”

“That’s what he said,” Katyal recalled, noting that the comment “got a lot of derision from the left” at the time. “I don’t think we should be surprised at the end of the day that he meant what he said.”

Upholding affordable health care

There have been visible strains between the president and the chief justice over the years, most notably during Obama’s first two years in office.

The flubbing of the oath at Obama’s swearing-in — when Roberts paused mid-sentence, Obama prematurely broke in to repeat the words, and then Roberts lost his place — sparked recrimination from both camps. Some White House aides privately groused, while Roberts told friends his requests to practice the oath with Obama had been rebuffed.

After an internal debate, the president’s aides asked the chief justice to deliver the oath of office again a day later, in the White House’s Map Room.

More substantively, the two men clashed when Obama, during his 2010 State of the Union address, criticized the court’s 5-to-4 decision in the campaign finance case Citizens United v. Federal Election Commission while several justices sat in the front row of the audience.

“With all due deference to separation of powers, last week the Supreme Court reversed a century of law that I believe will open the floodgates,” the president said, referring to the decision eliminating the limit on the total amount of money wealthy donors can contribute to candidates and political committees.

Justice Samuel A. Alito Jr. was seen to murmur “Not true” as he sat in the House chamber that night. Six weeks later, Roberts told an audience at the University of Alabama Law School that he was “very troubled” by the “setting, circumstance and decorum” that now marked the president’s annual address to Congress.

“To the extent the State of the Union has degenerated into a political pep rally, I’m not sure why we are there,” Roberts said.

White House officials — who had debated before the State of the Union whether the president should make his criticism during that speech or in another forum — were unapologetic.

“What is troubling is that this decision opened the floodgates for corporations and special interests to pour money into elections — drowning out the voices of average Americans,” then-White House press secretary Robert Gibbs said in a statement, adding that the president was determined to curb the influence of special interests and lobbyists in Washington. “That is why he spoke out to condemn the decision and is working with Congress on a legislative response.”

Still, Roberts believes in his ceremonial duties; he has not skipped a State of the Union address, though other justices often do. Differences emerged again when Roberts pressed the court to scale back a key part of the Voting Rights Act in the 2012 decision Shelby County v. Holder. Many who know Roberts say he is more interested in undoing race-based programs than health-care legislation.

On Thursday, the court gave the administration a big win not only on health care but in a second major case, concerning a tool that civil rights groups see as essential in combating racial discrimination in housing. In that case, Roberts dissented.

Even if the two do not agree on much, Roberts is often on Obama’s mind when it comes to judicial scrutiny, aides say. When administration lawyers were preparing their defense of the health-care law’s constitutionality, several of the president’s aides plotted how to sway Kennedy, the court’s traditional swing vote. But Obama and his then-White House counsel, Kathryn Ruemmler, were focused on how to win Roberts over to their side.

“We were very conscious of the chief justice’s view of his own role as a steward of the court, as an institutional matter,” recalled a senior administration official who spoke on the condition of anonymity to discuss internal deliberations. “As an advocate thinking about how to present your case, you have to think about individual justices and their past jurisprudence. It is all about, at the end of the day, getting five votes in your favor.”

In 2005, Obama made it clear to those close to him he never doubted Roberts had the skill to serve on the nation’s highest court, but Obama was aware an aye vote for his confirmation could jeopardize his standing in the Democratic Party. Publicly, he said of his concern about “the depth and breadth” of Roberts’s empathy for the weak, “I hope that I am wrong.”

And while Thursday’s decision did not turn on the question of compassion — Katyal called it “just straightforward Law 101” — it is now conservatives who are wondering whether they had misjudged Roberts a decade ago when he was nominated for the court.

Asked whether he still considers Roberts a conservative, Rep. Matt Salmon (R-Ariz.) said in an interview, “I don’t know that you can label the guy in any way, shape or form right now.”

Carrie Severino, chief counsel with the Judicial Crisis Network and a former clerk to Justice Clarence Thomas, was more blunt, mocking Roberts’s decision that exchanges “established by the state,” as part of the law reads, could also refer to federal marketplaces:

“The two biggest losers today are the English language and the legacy of Chief Justice Roberts.”

Mike DeBonis and Katie Zezima contributed to this report.