6/28/12 10:08 AM EDT
Updated: 6/28/12 11:10 AM EDT

The Supreme Court upheld most of President Barack Obama’s health care law Thursday, ruling that Congress did not overstep its power by requiring nearly all Americans to buy health insurance.

Chief Justice John Roberts joined with the court’s four liberal justices in the ruling, which says Congress had the authority to impose the law’s individual mandate under Congress’s taxing power.

There was one rebuke to the Obama administration: The court ruled that the states can reject the law’s Medicaid expansion.

Still, the rest of the ruling is a surprise victory for the Obama administration, which faced a tough grilling from the court — including from Roberts — during the oral arguments in March. It guarantees that most of the two-year-old law will stay in place, avoiding the massive disruption to the health care industry that would have resulted if the mandate had been struck down.

“Simply put, Congress may tax and spend,” Roberts wrote in the majority opinion. “This grant gives the federal government considerable influence even in areas where it cannot directly regulate.”

“The federal government may enact a tax on an activity that it cannot authorize, forbid or otherwise control,” Roberts wrote.

(See also: Full coverage of the health care reform decision)

In a stinging dissent, Justice Anthony Kennedy suggested that the other justices wanted to wipe out the entire law. “In our view, the entire Act before us is invalid in its entirety,” he wrote.

In the ruling, Roberts wrote that the court rejected the idea that the mandate regulates people under existing commercial activity. But the court ruled that Congress can impose mandate under the taxing power.

“It instead compels individuals to become active in commerce by purchasing a product, on the ground that their failure to do so affects interstate commerce,” Roberts wrote.

“The question is not whether that is the most natural interpretation of the mandate, but only whether it is a ‘fairly possible’ one,” Roberts wrote. “The government asks us to interpret the mandate as imposing a tax, if it would otherwise violate the constitution. Granting the act the full measure of deference owed to federal statutes, it can be so read.”

The ruling came as a surprise, as conservative justices appeared skeptical of the law during oral arguments in March. They seemed most skeptical of the so-called individual mandate, which requires Americans to have health insurance.

To read entire story, click here.