Artist rendering shows attorney Paul Clement before the supreme court justcies on the final day of arguments in the healthcare law hearings. Photograph: Carolyn Kaster/AP

The US supreme court confronted what one justice characterised as a choice between a "wrecking operation" and a "salvage job" as it considered the future of Barack Obama's signature healthcare reforms if a key component is found to be unconstitutional.

In a third and final day of an unusually long hearing Wednesday on the politically charged legislation, the court heard from its opponents that the entire Patient Protection and Affordable Care Act should be struck down if, as looks possible, the justices find a requirement for almost all Americans to buy medical insurance to be unconstitutional.

Paul Clement, acting for 26 US states that oppose the legislation, said that the requirement for mandatory insurance is designed to fund many of the law's other reforms. He said that without the funding, they are unworkable.

"If the individual mandate is unconstitutional, then the rest of the act cannot stand," said Clement.

The government acknowledged that the loss of the insurance requirement will make some other parts of the legislation unworkable. It said that the loss of funds from about 40 million more people paying insurance would cause the collapse of some new requirements, such as a bar on insurance companies turning away people with pre-existing conditions. But it argued that most of the hundreds of other provisions of the act could remain.

One of the court's most conservative justices, Antonin Scalia, argued for striking down the entire legislation and letting Congress begin again on the grounds that the court cannot decide the fate of the law piecemeal.

"My approach would say if you take the heart out of the statute, the statute's gone. That enables Congress to do what it wants in the usual fashion. And it doesn't inject us into the process of saying, this is good, this is bad, this is good, this is bad," he said.

But sending the entire legislation back to Congress is all but certain to kill the reforms because the House of Representatives has fallen under Republican control since the legislation was passed two years ago and its leadership has said it intends to overturn the law, not revise it.

Several of the more liberal justices challenged Scalia's view.

Ruth Bader Ginsburg asked Clement why it is necessary to make Congress pass new legislation regarding parts of the healthcare reform that are not under challenge in court.

"I mean it's a question of whether we say everything you do is no good, now start from scratch, or to say, yes, there are many things in here that have nothing to do frankly with the affordable healthcare and there are some that we think it's better to let Congress to decide whether it wants them in or out," she said. "So why should we say it's a choice between a wrecking operation, which is what you are requesting, or a salvage job. And the more conservative approach would be salvage rather than throwing out everything."

The position of Justice Anthony Kennedy was closely watched because he is considered a key swing vote both on the question of the constitutionality of the insurance requirement and whether to strike down the whole law.

On Tuesday, Kennedy appeared to tilt toward the argument that compulsory insurance is unconstitutional because it greatly expands the powers of the government by, for the first time, obliging Americans to buy a product.

The tone of Kennedy's questioning on Wednesday indicated that he has already determined that mandatory insurance is illegal. He then suggested that because removing the insurance requirement fundamentally changes the health reform legislation into something that Congress did not envisage, the court would be acting with restraint if it struck down the entire legislation.

He gave the example of the effect on the finances of insurance companies that the loss of the compulsory insurance would have.

"By reason of this court, we would have a new regime that Congress did not provide for, did not consider. That, it seems to me, can be argued at least to be a more extreme exercise of judicial power than striking down the whole," said Kennedy.

One of the liberal justices, Sonia Sotomayor, expressed disquiet at the suggestion that the supreme court should take on the functions of Congress by scrapping the entire legislation instead of giving it the opportunity to fix the parts that are unconstitutional.

"Are you suggesting we give more power to the court?" she asked Clement. "What's wrong with leaving it in the hands of the people who should be fixing this, not us?"

Ginsburg picked up on the theme of where authority lies in deciding the future of the remaining parts of the legislation even if the individual mandate is declared illegal.

"Who is the proper party to take out what isn't infected by the court's holding, with all these provisions where there may be no standing, one institution clearly does have standing, and that's Congress. And if Congress doesn't want the provisions that are not infected to stand, Congress can take care of it. It's a question of which side should the court say, we're going to wreck the whole thing, or should the court leave it to Congress?" she asked.

Later on Wednesday, the court heard arguments on another aspect of the legislation covering expansion of access to a programme for free healthcare for the poor, Medicaid. The law opens the way for about 17 million more people to receive Medicaid which is administered by individual states.

Lawyers for some states argued that the federal government had overstepped its powers in imposing the change on them. Some of the conservative judges asked whether Washington has the right to set the rules for state governments.

Some of the court's more liberal justices leaned toward the government on the issue, saying that as Medicaid is largely financed by Washington it could set the terms.

Sign up for the Guardian Today

Our editors' picks for the day's top news and commentary delivered to your inbox each morning.