(Bloomberg News) The U.S. Supreme Court upheld the core of President Barack Obama's health-care overhaul, giving him an election-year triumph and preserving most of a law that would expand insurance to millions of people and transform an industry that makes up 18 percent of the nation's economy.

The justices, voting 5-4, said Congress has the power to make Americans carry insurance or pay a penalty. That requirement is at the center of the law, which also forces insurers to cover people with pre-existing health conditions. The court limited the law's extension of the Medicaid program for the poor by saying the federal government can't threaten to withhold existing money from states that don't fully comply.

The ruling frames the health-care issue for this year's elections and is a victory of symbolism as well as substance for Obama. Chief Justice John Roberts, a Republican appointee, joined four Democratic-selected justices to give the president a majority on a law that has divided the country along ideological and partisan lines throughout his presidency.

Roberts, writing for the court, said Congress had the authority to impose the insurance requirement under its power to levy taxes.

While the federal government "does not have the power to order people to buy health insurance," Roberts wrote, "the federal government does have the power to impose a tax on those without health insurance." The law "is therefore constitutional because it can reasonably be read as a tax."

Longest Arguments

The decision on the Patient Protection and Affordable Care Act is the climax to an epic legal fight that featured the longest courtroom arguments in 44 years, a record number of briefs and extraordinary public interest in a Supreme Court case. The case tested both the constitutional powers of Congress and the willingness of the Roberts court to overrule the other two branches of the federal government.

Justices Antonin Scalia, Anthony Kennedy, Clarence Thomas and Samuel Alito dissented, saying they would have struck down the entire statute.

"The fragmentation of power produced by the structure of our government is central to liberty, and when we destroy it, we place liberty at peril," the dissenters wrote. "Today's decision should have vindicated, should have taught, this truth; instead, our judgment today has disregarded it."

Among the majority, Justices Ruth Bader Ginsburg and Sonia Sotomayor voted to uphold the entire statute. Justices Stephen Breyer and Elena Kagan agreed with Roberts in limiting the Medicaid expansion.

Defining Accomplishment

The dispute marked the first time the Supreme Court had considered a president's defining legislative accomplishment in the middle of his re-election campaign. The Supreme Court hadn't considered a law of comparable scope since the justices overturned part of the National Industrial Recovery Act in 1935 during President Franklin Roosevelt's New Deal.

The law marks the biggest change to the U.S. health system since Medicare and Medicaid were established in 1965. The law was designed to expand coverage to at least 30 million people -- primarily by expanding Medicaid and setting up online markets where consumers could buy insurance -- while controlling the soaring costs of health care.

Republicans, including presidential candidate Mitt Romney, have called for repeal of the law.

26 States

The law was challenged by 26 Republican-controlled states and a small-business trade group. They contended the measure exceeded Congress's constitutional powers to regulate interstate commerce and impose taxes.

"The battle isn't over," said Republican Attorneys General Association Chairman Scott Pruitt of Oklahoma, in a statement. "It now is up to the political process to repeal the act and replace it with measures that address the health-care crisis within the confines of the Constitution."

Roberts rejected the commerce argument while voting to uphold the law under Congress's taxing power.

"It may often be a reasonable financial decision to make the payment rather than purchase insurance," Roberts wrote. "Although the payment will raise considerable revenue, it is plainly designed to expand health insurance coverage. But taxes that seek to influence conduct are nothing new."

The insurance mandate requires Americans to get coverage by 2014 or pay a penalty. The concept was championed by Republicans years ago as an alternative to Democratic proposals for a single government-run health system.

Share of Funding

The Medicaid expansion was designed to extend eligibility to those with incomes up to 138 percent of the federal poverty line. States that didn't comply with the new expansion would have lost all or part of their share of federal Medicaid funding.

Roberts said Congress can require states to meet conditions to receive new Medicaid money, though it can't take away existing funding.

"The financial 'inducement' Congress has chosen is much more than 'relatively mild encouragement' -- it is a gun to the head," Roberts wrote. "What Congress is not free to do is to penalize states that choose not to participate in that new program by taking away their existing Medicaid funding."

The ruling removes some of the uncertainty the health industry had faced about the future of government policy. By upholding the individual mandate, the court left intact a provision that will give insurers such as UnitedHealth Group Inc. millions of relatively healthy, low-cost policyholders.

In Effect

Some parts of the law have already gone into effect, including provisions that close a gap in prescription-drug coverage under Medicare, allow 2.5 million young adults to stay on their parents' insurance until age 26, and provide free mammograms, colonoscopies and flu shots.

The health-care measure's enactment in March 2010 marked the culmination of decades of efforts by Democrats and Republicans alike to put in place a universal health care program. For Obama, congressional approval marked a victory that had eluded presidents from Harry Truman to Bill Clinton.

Passage in the Democratic-controlled Congress came only after months of lobbying, deal-making and parliamentary maneuvering. In the end, not a single Republican voted in favor of the law. The measure passed the House by a 219-212 tally.

From the beginning, the law divided the public, with opposition fueling the Tea Party movement and helping produce the 2010 Republican takeover of the House. A Bloomberg National Poll conducted in March found that 37 percent of respondents said the law should be repealed, 11 percent said it should be left alone and 46 percent said it may need small modifications.