U.S. President Barack Obama won a huge political victory as the U.S. Supreme Court upheld his controversial health-care law, which requires uninsured Americans to purchase health insurance under threat of a financial penalty.

"I know there will be a lot of discussion today about the politics of all this — about who won and who lost. That's how these things tend to be viewed here in Washington" Obama said Thursday from the White House. "But that discussion completely misses the point. Whatever the politics, today's decision was a victory for people all over this country whose lives will be more secure because of this law and the Supreme Court's decision to uphold it."

In a 5-4 ruling, Chief Justice John Roberts, appointed to the court by former president George W. Bush, joined the court's four liberal justices, Stephen Breyer, Ruth Bader Ginsburg, Elena Kagan and Sonia Sotomayor, in upholding the law.

Roberts, who most observers had thought would side with the conservative-leaning judges, instead wrote the majority opinion in support of the law, saying the mandate may be upheld under the power of Congress to tax.

"The Affordable Care Act's requirement that certain individuals pay a financial penalty for not obtaining health insurance may reasonably be characterized as a tax," Roberts wrote. "Because the constitution permits such a tax, it is not our role to forbid it, or to pass upon its wisdom or fairness."

si-nurse-baby-02876404

The decision means the historic health-care overhaul will continue to go into effect over the next several years, affecting the way that countless Americans receive and pay for their personal medical care. (Rick Bowmer/Associated Press)

Ironically, Obama had previously strongly rejected that the mandate was the equivalent to a tax increase. "I absolutely reject that notion," he told ABC's George Stephanopoulos in an interview in 2009.

Justice Anthony Kennedy, who was considered the swing vote, joined justices Samuel Alito, Antonin Scalia and Clarence Thomas in the dissent.

"The act before us here exceeds federal power both in mandating the purchase of health insurance and in denying non-consenting states all Medicaid funding," the dissenters said in a joint statement.

The Obama administration had argued that the federal government had the right to legislate Americans into purchasing health insurance under the commerce clause of the U.S. Constitution, which states that the U.S. Congress has the power "to regulate commerce …among the several states."

The law, which seeks to cut skyrocketing health-care costs and extend health insurance to 30 million uninsured Americans, was challenged by officials in 26 states, led by Florida, who argued the White House overreached in its interpretation of the clause.

They claimed the federal government had no right to compel private citizens to purchase a certain product, in this case health insurance, that the law infringes on state rights, and that the individual mandate should be struck down as unconstitutional.

Roberts agreed that the government does not have the right to impose an individual mandate under the commerce clause.

"Construing the commerce clause to permit Congress to regulate individuals precisely because they are doing nothing would open a new and potentially vast domain to congressional authority," Roberts wrote.

"Indeed, the Government’s logic would justify a mandatory purchase to solve almost any problem."

"The individual mandate forces individuals into commerce precisely because they elected to refrain from commercial activity. Such a law cannot be sustained under a clause authorizing Congress to "regulate commerce," he wrote.

Roberts made note of the "severe burden" that taxation can impose, especially one motivated by a regulatory purpose.

However, he wrote that "a tax nonetheless leaves an individual with a lawful choice to do or not do a certain act, so long as he is willing to pay a tax levied on that choice."

The Patient Protection and Affordable Care Act, derisively referred to by its Republican critics as Obamacare, was considered to be the U.S. president's signature domestic policy achievement.

Republican presidential candidate Mitt Romney said he disagreed with the top court's decision, reaffirming that on his first day if elected president, he would act to repeal the law.

"Let's make clear that we understand what the court did and did not do. What the court did today was say that Obamacare does not violate the constitution. What they did not do was say that Obamacare is good law or that it's good policy," he said.

Polls show that while the majority of Americans are opposed to "Obamacare" as a whole, and in particular, the individual mandate, they support many provisions of the bill, which include forcing insurance companies to insure those with pre-existing conditions and that individuals can stay on their parents' health-care coverage until they reach the age of 26.

With files from The Associated Press