WASHINGTON ­— Chief Justice John Roberts joined the liberal wing of the Supreme Court Thursday to save the heart of President Barack Obama’s landmark health-care law, agreeing that the requirement for nearly all Americans to secure health insurance is permissible under Congress’ taxing authority.

What it means

What does the U.S. Supreme Court’s decision mean for South Carolinians? Among other things:Expect more political fighting over how to implement health-care reform. Despite the high court’s ruling, Gov. Nikki Haley’s administration said Thursday the state will “opt out” of a provision of the bill that would have extended Medicaid coverage to an estimated half-million of the state’s poorest residents beginning in 2014.Also in 2014, residents will be able to buy health insurance on “exchanges” or websites for comparison shopping. South Carolina officials have decided the federal government and not the state should manage that website. The federal government has not said specifically how the exchanges will work.Insurance companies must spend at least 80 percent of premium dollars on health care and quality improvements instead of overhead, executive salaries or marketing. If they do not, they must provide rebates or reduce premiums to customers. This summer, more than a quarter-million South Carolinians with private insurance coverage will receive more than $19.6 million in rebates from insurance companies, according to the U.S. Department of Health and Human Services. The rebates will average a reported $131 per family.

Even as it upheld that central component of the Patient Protection and Affordable Care Act, however, the court modified another key provision of the law, ruling that the federal government cannot withdraw existing Medicaid funding from states that decide not to participate in a broad expansion of Medicaid eligibility.

The court’s historic compromise, which will affect the health-care choices of millions of Americans, amounts to a major victory for the White House less than five months before the November elections, although the Medicaid decision sets new limits on the power of the national government.

Obama welcomed the ruling, which he called “a victory for people all over this country whose lives will be more secure.”

He said the decision would allow the health-care law to offer millions of currently uninsured Americans “an array of quality, affordable health-insurance plans to choose from” starting in 2014.

“Today the Supreme Court also upheld the principle that people who can afford health insurance should take the responsibility to buy health insurance,” Obama said in speech at the White House.

He said he knew that this individual mandate “wouldn’t be politically popular” and that the debate over the law “has been divisive.” But he said the law was “good for the country” and “good for the American people.”

“The highest court in the land has now spoken,” Obama said. “We will continue to implement this law. And we’ll work together to improve on it where we can.

“But what we won’t do, what the country can’t afford to do, is refight the political battles of two years ago or go back to the way things were. With today’s announcement, it’s time for us to move forward.”

Illustrating the divided nature of the ruling, Justice Anthony Kennedy, representing the court’s most consistent conservatives, read a scathing dissent, while Justice Ruth Bader Ginsburg, representing the liberals, issued a separate opinion supporting Roberts but differing with him on key aspects of the case.

Still, Ginsburg’s summation seemed to serve as the bottom line: “In the end, the Affordable Health Care Act survives largely unscathed.”

Joined by Justices Antonin Scalia, Clarence Thomas and Samuel Alito, Kennedy called the majority’s decision a “vast judicial overreaching” that “creates a debilitated, inoperable version of health care regulation that Congress did not enact and the public does not expect.”

The Medicaid ruling, Kennedy said, leaves state governments in a difficult position. “States must choose between expanding Medicaid or paying huge tax sums ... for the sole benefit of expanding Medicaid in other states.”

The high court rejected the argument, advanced by the Obama administration, that the individual mandate was constitutional under the commerce clause of the Constitution.

But Roberts joined the court’s four liberal justices — Ginsburg, Sonia Sotomayor, Stephen Breyer and Elena Kagan — in ruling that a penalty for refusing to buy health insurance amounts to a tax and thus is permitted.

Passage of the legislation by the Democratic-controlled Congress in 2010 capped decades of efforts to implement a national program of health care.

Eventually, the act is supposed to extend health-care coverage to more than 30 million Americans who currently lack it.

“No longer will Americans be a heart attack or a car crash away from bankruptcy,” Senate Majority Leader Harry Reid, D-Nev., said in a speech on the Senate floor Thursday after the ruling. “No longer will Americans live in fear of losing their health insurance because they lose their job.”

Republicans in Congress and GOP presidential challenger Mitt Romney have vowed to try to repeal the measure.

“What the court did not do on its last day in session, I will do on my first day as president,” Romney said Thursday. “And that is, I will act to repeal Obamacare.”

The health-care issue thrust the Supreme Court into the public spotlight unlike anything since its role in the 2000 presidential election. The court’s examination of the law received massive media coverage, especially during three days of oral arguments in March, and its outcome remained Washington’s most closely guarded secret.