File photo / Associated PressMassachusetts Gov. Mitt Romney, right, shakes hands with Massachusetts Health and Human Services Secretary Timothy Murphy in 2006 after signing into law a landmark bill designed to guarantee that virtually all Massachusetts residents have health insurance at Faneuil Hall in Boston. Sen. Edward Kennedy, D-Mass., is center, and Massachusetts House Speaker Salvatore DiMasi, is at right.

By STEVE LeBLANC

BOSTON – As governor, Mitt Romney raised hundreds of millions of dollars in new and higher fees to help Massachusetts close a looming budget gap – all the while seeking to preserve a no-new-tax record as he eyed a run for president.

Now, the Supreme Court decision that upheld President Barack Obama’s 2010 health care law is threatening to unravel Romney’s no-tax claim, even as it hands the GOP a rallying cry in the presidential contest.

At issue is whether the so-called “individual mandate” at the core of both the federal law signed by Obama and the 2006 state law signed by Romney is a penalty or a tax. The mandate requires everyone who can afford insurance to have it or face what Massachusetts officials have called a penalty.

In the 5-4 decision, Chief Justice John Roberts said the mandate could be considered a tax and was therefore constitutional.

The question is so politically knotty that even Democratic Gov. Deval Patrick, an Obama ally, hasn’t targeted Romney on the issue.

“I don’t care what it’s called, what it is, is a solution. And it’s an important one.” Patrick said when pressed by reporters this week.

On Wednesday, Romney said the court ruling means the individual mandate in Obama’s law is a tax.

“The majority of the court said it’s a tax and therefore it is a tax,” Romney told CBS News.

But Romney also insisted the ruling didn’t undercut his no-tax claim as governor. He said Roberts was clear that states have the power under the Constitution to mandate purchases using mechanisms other than taxes.

Even some of the staunchest tax foes in Massachusetts say they agree the mandate is not a tax.

“A tax is something on what you’re doing or buying, not on something you’re not doing,” said Barbara Anderson, a Romney supporter and executive director of Citizens for Limited Taxation. “It’s not a tax when Romney did it and it’s not a tax when Obama did it.”

Romney’s hesitance to call Obama’s individual mandate a tax – a top aide initially said it wasn’t – has run counter to national Republicans who have pounced on the ruling, saying it proves Obama passed a major tax increase.

Democrats have been equally quick to point to Romney’s insistence that the Massachusetts mandate was a penalty, while the national mandate is a tax.

“He caved in to right-wing pressure,” said state Rep. Jeffrey Sanchez, D-Boston, noting that Democrats also classify the federal mandate as a penalty.

The mandate is key to both laws.

When Romney, now the presumptive Republican presidential nominee, pushed for the mandate in 2006, he said it would discourage “free riders,” those who can afford health coverage but instead rely on emergency rooms for free care and drive up insurance premiums for everyone else.

The logic was similar for the federal law.

Unless more people are brought into the insurance pool, supporters say, there’s no way to pay for other parts of the federal law, including the ban on insurance companies denying coverage for those with pre-existing medical conditions.

In Massachusetts, with a population of more than 6.5 million, relatively few have been targeted by the mandate. About 44,000 Massachusetts tax filers were assessed the penalty in 2010, down from 67,000 in 2007.

The debate also refocused attention on Romney’s use of fees to raise revenue.

The business-backed Massachusetts Taxpayers Foundation said Romney and the Democratic-run Legislature raised about $350 million annually in additional fees during Romney’s first two fiscal years as governor. Romney has said the fee increases were about $240 million in the 2004 fiscal year.

A National Conference of State Legislatures study put the figure higher, saying Massachusetts in 2003 imposed more than $501.5 million in fee hikes, more than any other state.

Among the fee increases: Marriage licenses went from $4 to $50; driving permits from $15 to $30; deed-recording fees from $25 to $100; and mortgage-recording fees from $36 to $158.

Romney defenders said they sympathize with his handling of the Supreme Court decision.

“Romney is doing the best he can, given that John Roberts took him and everyone one else down the rabbit hole into Wonderland,” Anderson said.