Barack Obama has said it would be wrong for the "unelected" supreme court to take the "unprecedented and extraordinary" decision to strike down his signature health care legislation when it was passed by an elected Congress.

The comments suggest the president may make an election issue of those described by Democrats as partisan judges if they throw out the Affordable Care Act following last week's dramatic hearings at which the aggressive tide of questioning from some of the justices suggested that the conservative majority is hostile to the legislation. Their decision is expected in June.

"I am confident that the supreme court will not take what would be an unprecedented, extraordinary step of overturning a law that was passed by a strong majority of a democratically elected Congress," Obama said.

The president chided Republicans for making "judicial activism" an election issue, by objecting to rulings ranging from the supreme court's finding of a right to abortion to the recent striking down by federal judges of a referendum barring gay marriage in California, while pressing the judiciary to overturn the will of Congress.

"I'd just remind conservative commentators that, for years, what we have heard is, the biggest problem on the bench was judicial activism, or a lack of judicial restraint, that an unelected group of people would somehow overturn a duly constituted and passed law," Obama said. "Well, this is a good example, and I'm pretty confident that this court will recognise that and not take that step."

The court's ruling is bound to become an election issue whichever way it goes, coming just months before November's vote.

If the justices uphold the law, Republicans are likely to say the only way to overturn it is to win control of the White House. If the court strikes down the legislation, Democrats will campaign to regain control of House of Representatives in order to save the reforms.

The president's comments came hours after Congressman James Clyburn, assistant Democratic party leader in the House of Representatives, suggested that if the ruling goes against the healthcare legislation then Obama should take on the supreme court.

"I think the president ought to take a look at what went on in the years before. We have seen presidents run against Congress and we have seen presidents run against the supreme court. Franklin Roosevelt did it to the supreme court," he said.

In the 1930s, the conservative majority on the supreme court handed down a series of decisions that struck down many of the pillars of the New Deal. Roosevelt struck back in 1937 by portraying the court as acting against the democratic will and launching a failed bid to pass legislation adding additional members sympathetic to his cause.

It's unlikely that Obama would choose such a dramatic confrontation. But opinion polls show that if the supreme court rules against the health care law then the president may be able to make political capital from attacking the justices as partisan as he attempts to win re-election and see the Democrats take control of the House of Representatives again in order to pass new health reforms that will stand the constitutional test.

Neither the supreme court nor the healthcare law emerged from the hearings unscathed in public standing.

A Pew Research Center poll published on Monday showed that about one in five Americans has a more negative opinion of the supreme court as a result of the hearings. A similar number has views the health reform legislation less favourably.

Neera Tanden, an adviser to Obama's last presidential campaign and president of the Center for American Progress policy group, said last week that the supreme court's standing in the eyes of the public has been damaged by the hearings.

"Just look at the partisan nature of the questioning, when conservative judges who in previous experience have talked about deference to elected branches have to be reminded by their liberal brethren that their role is not policymakers," she said. "The supreme court is a vulnerable institution in that it has great power and takes its legitimacy from a belief in the public that it acts in a nonpartisan manner. To have a decision that strikes at the heart of the Affordable Care Act, which people have struggled for decades to pass, is the president's singular domestic policy accomplishment, I fear for the institution itself."

"Already there's much less support for the court than there has been in the past. A decision by this court to strike down the individual mandate or the whole bill on a partisan vote I think will dramatically undermine the institution itself."