Since then the politics of health care have grown more twisted and tangled than the two snakes entwined around the staff in a caduceus, which is sometimes used as a symbol of medicine. It is now Republicans and conservatives who oppose the individual mandate, arguing that it is unconstitutional, while Democrats, who were long resistant to it, are its biggest defenders.

Democratic health care analysts have been taken aback by the speed with which Republicans have made the individual mandate a symbol of socialist totalitarianism to much of their base.

“I noted the irony of a Republican idea being the source of Republican opposition,” said Neera Tanden, president of the Center for American Progress, a liberal research group, who served in the Obama administration and as the policy director for Mrs. Clinton’s presidential campaign in 2008. And longtime supporters of the mandate, who for years had believed the biggest obstacle to enacting it was attracting Democratic support, saw Democrats become its last supporters. “It totally flipped,” said Peter Harbage, a health care analyst who has advised Democratic and Republican supporters of individual mandates.

These shifting political winds have become a major factor in the presidential campaign. Mitt Romney is often challenged by Republican rivals about the health care law he signed as the governor of Massachusetts, which also contains an individual mandate. Mr. Gingrich is often asked about his years of support for the idea. And Mr. Obama — who opposed the individual mandate four years ago as a candidate, but came to accept it as president — is now waiting to see whether the Supreme Court upholds the idea or strikes it down.

Some conservatives originally saw the individual mandate as a way to make certain that uninsured people who became ill or were injured — but were still entitled by law to medical treatment — did not push the cost of their care onto others.