Updated

The Supreme Court on Thursday upheld nearly all of President Obama's health care overhaul, in a landmark ruling that will have sweeping consequences for the economy, the election and America's health care system.

In a 5-4 decision, the court ruled as constitutional the so-called individual mandate requiring most Americans to obtain health insurance starting in 2014.

The ruling is a victory for the president, ensuring for now that his signature domestic policy achievement remains mostly intact. It also ensures that the law will play a prominent role in the general election campaign, as Republican candidate Mitt Romney vows to repeal the law if elected.

Obama is expected to speak publicly about the ruling later in the day.

Chief Justice John Roberts, who was appointed during a Republican administration, joined the four left-leaning justices on the bench in crafting the majority decision.

More On This...

"The Affordable Health Care Act survives largely unscathed," Justice Ruth Bader Ginsburg, one of those justices, declared at the end of the reading, claiming the "setbacks" going forward will be "temporary blips, not permanent obstructions."

The ruling relied on a technical explanation of how the individual mandate could be categorized. Roberts, in the opinion, said the mandate could not be upheld under the Constitution's Commerce Clause. However, it could be upheld under the government's power to tax.

"The Affordable Care Act is constitutional in part and unconstitutional in part  The individual mandate cannot be upheld as an exercise of Congress's power under the Commerce Clause," Roberts wrote. "That Clause authorizes Congress to regulate interstate commerce, not to order individuals to engage it. In this case, however, it is reasonable to construe what Congress has done as increasing taxes on those who have a certain amount of income, but choose to go without health insurance. Such legislation is within Congress's power to tax."

Roberts stressed that the decision does not speak to the merits of the law. "We do not consider whether the act embodies sound policies. That judgment is entrusted to the nation's elected leaders," he said.

The ruling did rein in one element of the law -- the expansion of Medicaid across the country to take in millions of low-income Americans. The opinion allows Washington to offer more funding to states to expand the program, but says the federal government cannot penalize states for not participating in the new program by withholding existing Medicaid funds.

Democrats, many of whom were bracing for the court striking down the mandate, celebrated the decision Thursday.

Rep. Charlie Rangel, D-N.Y., told Fox News that the ruling "gives us the opportunity to re-sell the bill, which we did not do before."

But Republicans vowed to re-double their campaign to repeal the still-controversial law.

"Today's ruling underscores the urgency of repealing this harmful law in its entirety," House Speaker John Boehner said in a statement. "Republicans stand ready to work with a president who will listen to the people and will not repeat the mistakes that gave our country ObamaCare."

Justice Anthony Kennedy, who was thought to be the swing vote on the decision, joined the minority in describing the whole law as invalid.

"The act is invalid in its entirety," Kennedy said from the bench. He went on to say the administration went to "great lengths to structure the mandate as a penalty, not a tax" -- challenging the majority's rationale for upholding the mandate.

Despite the persistent resistance to the law and the possibility that it could still be repealed, the historic decision Thursday will offer some measure of vindication for Obama, who devoted the first half of his term to pushing it through Congress.

The overhaul was one of the central planks of Obama's 2008 run for president. The faltering economy only later took a leading role in the race as the financial markets spiraled around the time of the party conventions. Obama, after taking the oath of office, dispatched with his administration's recession response by swiftly passing through the roughly $800 billion stimulus package.

The president immediately pivoted back to health care. He tasked allies in Congress with working out the specifics of a proposal, a process that would play out on the national stage over the course of a year.

As the economy continued to struggle, the debate over the health care bill became increasingly contentious. The financial industry bailout helped spawn the Tea Party, but that movement also rallied around opposition to the health care bill -- it was assailed by critics as a "takeover" of American health care, even as Democrats backed off items on their original wish list such as a government-run insurance plan.

The January 2010 election of Massachusetts Sen. Scott Brown, to fill the seat left by the late Sen. Ted Kennedy, threw a wrench into Democrats' plans as it gave Republicans enough seats to mount a filibuster. The Senate had already passed one version of the bill, but this put pressure on the House to effectively approve it or watch their goal of health care reform wither.

Ultimately, Democrats worked out a series of deals and approved the bill, which Obama signed, delivering on a central campaign promise. But only after a protracted and politically damaging debate, which contributed heavily to Democratic losses in the 2010 midterm elections.

The decision Thursday virtually guarantees the health care law will remain at the forefront of the 2012 campaign.

Click to read the opinion.