The Supreme Court today upheld the mandate that people buy health insurance at the center of President Obama‘s health care law, ruling it effectively constituted a tax and was therefore within the power of Congress and the president.

In a 5-4 ruling, the Court declined to strike down the mandate, which conservatives had cast as a power grab by the federal government.

The decision constitutes a major victory for President Obama, who spent two years pushing the health care law through Congress.

The decision also protects nearly all of the provisions of so-called Obamacare. Insurance companies can no longer charge higher rates or refuse to offer coverage to people who already have illnesses. Young adults can stay on their parents’ health plans till they are 26.

Seniors get new discounts for their prescription drug coverage. States that choose to will now have additional federal funds to pay for their Medicaid programs. Subsidies are provided for people to purchase insurance.

The original bill was estimated to expand health insurance to more than 30 million Americans. Because the Court struck down part of the Medicaid spending, it’s not exactly clear if that will still happen.

But millions of Americans are likely to get covered under the new law.

The decision is a blow for conservatives, who have for two years argued the law was unconstitutional. The Tea Party in part emerged from anger about the health care provision.

And for Obama, it is not just a political victory, but one on substance as well. The law is the biggest expansion of health insurance since Medicare and Medicaid were created in the 1960’s. It made his decision to push health reform instead of climate change or immigration reform or issues not seem a waste, as it would have if the court had struck down the law.

Follow Perry Bacon Jr. on Twitter at @perrybaconjr