The court handed Obama a campaign-season victory in rejecting arguments that Congress went too far in requiring Americans to have health insurance or pay a penalty.

Chief Justice John Roberts announced the court's judgment that allows the law to go forward with its aim of covering more than 30 million uninsured Americans.

Click here to read court's decision

The court, however, found problems with the law's expansion of Medicaid, but even there said the expansion could proceed as long as the federal government does not threaten to withhold states' entire Medicaid allotment if they don't take part in the law's extension.

The court's four liberal justices, Stephen Breyer, Ruth Bader Ginsburg, Elena Kagan and Sonia Sotomayor, joined Roberts in the outcome. Justices Samuel Alito, Anthony Kennedy, Antonin Scalia and Clarence Thomas dissented.