The Supreme Court ruled yesterday that alleged criminal acts that were safe from prosecution because a statute of limitations had expired cannot be prosecuted later even if the statute's time constraints are lifted.

The 5 to 4 ruling struck down a 1993 California law that allowed prosecution of childhood sex abuse cases years after the alleged crimes occurred and after a three-year statute of limitations had expired. The state law lifted the statute of limitations and allowed prosecution of any child sex abuse case within one year of a complaint being filed with police.

"California's law subjects an individual . . . to prosecution long after the state has, in effect, granted an amnesty," Justice Stephen G. Breyer wrote for the majority. "It retroactively withdraws a complete defense to prosecution after it has already attached, and it does so in a manner that allows the state to withdraw this defense at will and with respect to individuals already identified. 'Unfair' seems to us a fair characterization."

The decision may call into question not only state and federal efforts to expand the prosecution of sex offenders but also one aspect of the U.S. government's crackdown on terrorism. The USA Patriot Act, enacted by Congress after the Sept. 11, 2001, terrorist attacks, eliminated the statute of limitations on terrorism offenses that result in death or serious injury, or could do so. As with the California law, these provisions of the Patriot Act permit prosecutions that would have been barred under the old federal statute of limitations. In addition, in April, President Bush signed into law the PROTECT Act, which eliminated the statute of limitations on virtually all federal child abduction and abuse cases.

The Justice Department had no immediate comment on the impact of yesterday's ruling on prosecutions under the Patriot and PROTECT measures. "We are reviewing the decision," said Mark Carallo, a department spokesman.

But Jeffrey Fisher, author of a brief urging that the California law be struck down, said, "I think it basically invalidates that portion of the Patriot Act that allowed prosecution for terrorism after the old statute of limitations had expired."

In California, the Los Angeles County District Attorney's Office said that it will review more than 200 cases since 1993 that may be affected by the ruling. But prosecutors around the country said the decision will have little impact outside of California because it was the only state that had a law allowing the retroactive prosecution of cases for which the time limit had elapsed.

Yesterday's ruling will also not affect the prosecution of future terrorism or child abduction cases for acts done after the lifting of the federal statutes of limitations. Nor will it affect cases, such as those that may arise from the Sept. 11 attacks, that were still eligible for prosecution at the time that a statute of limitations was lifted or extended.

Breyer's majority opinion was joined by Justices John Paul Stevens, Sandra Day O'Connor, David H. Souter and Ruth Bader Ginsburg.

Justice Anthony M. Kennedy wrote a lengthy dissent, and was joined by Chief Justice William H. Rehnquist and Justices Antonin Scalia and Clarence Thomas. Kennedy engaged in a scholarly duel with Breyer over the correct application of a 1798 opinion by Justice Samuel Chase that has guided Supreme Court rulings on the ex post facto clause of the Constitution ever since.

Kennedy said the majority opinion "departs from established precedent" and "also disregards the interests of those victims of child abuse who have found the courage to face their accusers and bring them to justice. The court's opinion harms not only our Ex Post Facto jurisprudence but also these and future victims of child abuse."

The case, Stogner v. California, No. 01-1757, arose out of 1998 allegations by Marion R. Stogner's two daughters that he repeatedly had sex with them while they were under the age of 14. One daughter said the abuse against her occurred between 1955 and 1964, and the other said she was abused between 1967 and 1973.

At the time of the alleged offenses, the law in California was that such charges had to be brought within three years. But, in 1993, the state legislature, citing evidence that children rarely report abuse when it happens because they are frightened or ashamed, passed a law that permitted old charges to be prosecuted, provided that they allege "substantial" sexual conduct, are supported by "clear and convincing" independent evidence, and that prosecutors bring their cases within a year of the victims' coming forward.

To preclude controversial "recovered memory" allegations, the law bars cases based on "the opinions of mental health professionals."

Stogner objected to the charges, telling a California trial judge that the law amounted to a retroactive change in the definition of his alleged crime, and, as such, was a violation of the Constitution's ex post facto clause, which bars laws that retroactively change the legal consequences of an event or action.

The trial judge sided with Stogner, but a California appeals court overturned that ruling. When the California Supreme Court refused to intervene, Stogner appealed to the U.S. Supreme Court.

He was supported in the case by the National Association of Criminal Defense Lawyers and California Attorneys for Criminal Justice. David M. Porter, who worked on the defense lawyers' brief, said yesterday that the California law "violates the profound idea of the government playing by the rules it sets, and when it tries to change the rules of the game it violates our fundamental notions of fairness."

Staff writer Alan Cooperman contributed to this report.

Margaret Vaughan and her sister accused their father, Marion R. Stogner, of raping them when they were young. He challenged a California law that allowed prosecution after the statute of limitations had expired.