As Vice President Joe Biden told Obama after the law passed: "This is a big f---ing deal."
But netting that deal also cost the president tremendous political capital.
During the August recess of 2009, angry conservatives stormed congressional town halls to protest the legislation.
Repeal "Obamacare" became the rallying cry for a new wave of tea party-backed Republican House freshmen. Their massive sweep during the 2010 elections sent moderate Democrats packing and flipped control of the House of Representatives to the GOP.
Within months of the law's passage, the controversial law was in the courts. Conflicting appellate rulings ultimately led to the case being sent to the U.S. Supreme Court. Twenty-six states also pressed the Supreme Court to examine the law.
Energizing the tea party
Since the law was modeled after a similar Massachusetts measure, as the state's former governor, Romney, will face heightened scrutiny from conservatives determined to hold him to his campaign promises to repeal the law.
"I don't think there's an upside for the president here," said Ilya Shapiro, a senior fellow at the Libertarian-leaning Cato Institute and an expert on the Supreme Court. The ruling "energizes Republicans and the tea party."
Rudalevige added, "Romney will of course try to tie Obama back to the issue."
And Romney will have support from the Republican National Committee, which launched the website "PeopleVObamaCare.com" after the court's decision.
Romney press secretary Andrea Saul tweeted that in the hours after the ruling, the campaign raised $2.5 million online from more than 24,000 donors -- touting a hashtag, #FullRepeal, set up to promote their effort to overturn the law.
Reflecting after the ruling, Pelosi recalled the longtime dream of Sen. Ted Kennedy, a longtime champion of health care reform who died in 2009, a year before the legislation's passage.
"I knew that when he left us he would go to heaven and help pass the bill," she said from Capitol Hill. "And now he can rest in peace. His dream for America's families has become a reality."