Congress passed the law in response to the court’s ruling in the Nebraska case, responding specifically to the majority’s insistence in that case that the law must include an exception for circumstances when the banned procedure was necessary for the sake of a pregnant woman’s health. Congress provided an exception only to save a pregnant woman’s life, as Nebraska had, declaring that the procedure was never necessary for a woman’s health.

Justice Kennedy, in addressing the need for the health exception, said on Wednesday that it was acceptable for Congress not to include one because there was “medical uncertainty” over whether the banned procedure was ever necessary for the sake of a woman’s health. He said that pregnant women or their doctors could assert an individual need for a health exception by going to court to challenge the law as it applied to them.

Justice Ginsburg said that this approach was unrealistic and “gravely mistaken.” She said that requiring “piecemeal” litigation “jeopardizes women’s health and places doctors in an untenable position.”

Clarke D. Forsythe, president of Americans United for Life, a leading anti-abortion group, said approvingly that while the court did not technically overturn the Nebraska decision, the new ruling “effectively gutted it.”

Dr. LeRoy H. Carhart, the Nebraska doctor who challenged both the state law in 2000 and the federal law in this case, Gonzales v. Carhart, No. 05-380, said that “those who support this law are trying to outlaw all abortions, one step at a time.”

In his discussion of the court’s precedents, Justice Kennedy went so far as to suggest that the new ruling was in fact compelled by the court’s decision in Planned Parenthood v. Casey, the 1992 case that reaffirmed the basic holding of Roe v. Wade that women have a constitutional right to abortion. Justice Kennedy supported that result and helped write the decision’s unusual joint opinion.

On Wednesday, he said that “whatever one’s views concerning the Casey joint opinion, it is evident a premise central to its conclusion — that the government has a legitimate and substantial interest in preserving and promoting fetal life — would be repudiated were the court now to affirm the judgments of the courts of appeals” that struck down the federal law.