THE US Supreme Court has upheld President Barack Obama's healthcare law in an election-year triumph for him and fellow Democrats and a stinging setback for Republicans.

In a 5-4 ruling based on the power of Congress to impose taxes, the court preserved the law's "individual mandate" requiring that most Americans obtain health insurance by 2014 or pay a tax.

Opponents of the law had argued the mandate was an overreach into the private lives of citizens. The court was deeply divided on the issue but the majority ruled Congress' taxing power was more important.

Mr Obama said the ruling was a victory for the American people, and promised to implement it and improve upon it going forward.

"The highest court in the land has now spoken. We will continue to implement this law and we'll work together to improve on it where we can," Mr Obama said. "With today's announcement, it's time for us to move forward."

Rival Mitt Romney said after the ruling people must defeat Mr Obama in this year's election in order to overturn the law.

"If we're going get rid of 'Obamacare' we're going to have to replace President Obama. My mission is to make sure we do exactly that," he said.