BOSTON — Republican Mitt Romney is finding it hard to avoid comparisons between the Massachusetts health insurance mandate he signed into law and the federal version enacted by President Barack Obama as he weighs another presidential run.

A federal judge struck down the Obama mandate this week, and appeals of that ruling and other court challenges are likely to wend their way to the Supreme Court during the next two years, legal experts say.

The issue also is the focus of conservative talk-show chatter, and the similarity in the plans is already being highlighted by some of Romney's likely 2012 Republican rivals and even Obama himself.

In addition, the Internal Revenue Service just underscored the connection between the two: It hired the Massachusetts revenue department official charged with enforcing the state law to help federal officials enact the national mandate when it takes effect in 2014.

"It's clear that he backed a precursor of the Obama health care program, and he can't run against it no matter what distinctions he makes," said Jeffrey Berry, a Tufts University political science professor.

Minnesota Gov. Tim Pawlenty, a likely candidate planning a book tour to Iowa and New Hampshire after he leaves office next month, twice rejected suggestions for a similar state mandate and has joined in challenges to the federal mandate. Now he's among those poking at Romney.

"I think it's a problem for him in Republican primaries," said Berry. "Romney's thought at the time was everybody had to have skin in the game, and that mandate goes against classic conservative thought, which espouses freedom above all else."

The state universal health care law Romney signed in 2006 while Massachusetts governor required state residents to get private or government health insurance by 2007, and punished individuals and employers who did not with penalties now exceeding $1,000 per person annually.

Romney praised this week's ruling against the federal mandate, saying it supports his view "that Obamacare is an unconstitutional power grab by Washington," according to a statement from spokesman Eric Fehrnstrom.

Romney argues the Massachusetts mandate eliminated "free riders" who could afford to pay for insurance but did not and instead were treated at taxpayer expense in emergency rooms. Other states, he says, should be allowed to decide themselves whether, and how, to expand insurance coverage.

Yet the Massachusetts mandate is more sweeping — and penalizes the uninsured more severely — than the federal law signed this year by Obama, the Democrat Romney would likely face in 2012 if he won the GOP presidential nomination.

Romney signed the state law amid much fanfare, flanked by a Democratic patron of both the state and federal measures — the late Sen. Edward M. Kennedy of Massachusetts.

The political toxicity was evident even before the bill-signing, as Kennedy described the reaction of Sen. John McCain of Arizona, who would go on to beat Romney for the 2008 Republican nomination, as the liberal icon headed to Boston for the ceremony.

"He said to me, 'Make sure you put both arms around Mitt, will you Ted?'" Kennedy told The Associated Press.

The Massachusetts mandate requires residents to maintain health coverage meeting state-defined requirements. Those who lack coverage for more than 90 days face a penalty.

The first year, they were docked an amount equal to the personal exemption on their state income tax. Now they are penalized one-half the cost of the plan they could otherwise afford, which in 2009 was $1,068 for an individual. An even bigger penalty for 2010 will be announced before the end of the year.

The federal law similarly requires coverage, but with penalties that will be lower and slower to ramp up.

Those who lack coverage when the mandate takes effect in 2014 will be fined either $95 or 1 percent of their adjusted gross income, whichever is greater. In 2015, the penalty will be $325, or 2 percent. In 2016, it is $695, or 3 percent of adjusted gross income. Thereafter, it grows based on inflation, as it does in Massachusetts.

The law signed by Romney also defines more broadly than the federal law who is considered uninsured.

Under the Massachusetts law, employees who can afford insurance — but are enrolled in a company plan that does not meet the basic state requirements — are treated as if they lack insurance and are subject to the penalty. They can avoid it only if they buy qualifying coverage on their own.

The federal law does not penalize employees who maintain such inferior plans after the mandate takes effect in 2014.

Romney is unfazed by potential critics and ready to defend his record.

"The Massachusetts health care law came up in the 2008 campaign, and if Mitt Romney decides to run again, I'm sure it will be discussed again," said Fehrnstrom, the former governor's spokesman. "Everyone who runs for president is going to have to talk about their record, whatever it is."