WASHINGTON (AP) _ States can keep violent sexual predators locked up after they serve their prison sentences even if they are not mentally ill, the Supreme Court ruled today.

Ruling 5-4 in the case of an admitted pedophile from Kansas, the justices said such people can be held if they are considered mentally abnormal and are likely to commit new crimes.

Such confinement _ intended to protect society _ does not violate the constitutional right to due process and is not double punishment for the same crime, the court said.

The ruling means Kansas can continue to confine Leroy Hendricks, who was convicted five times of child-molesting and has said his death is the only way to guarantee he won't commit new crimes against children.

``The court has recognized that an individual's constitutionally protected interest in avoiding physical restraint may be overridden even in the civil context,'' Justice Clarence Thomas wrote for the court.

The Kansas law does not amount to a criminal prosecution or punishment, the justice said.

``The challenged act unambiguously requires a finding of dangerousness either to one's self or to others as a prerequisite to involuntary confinement,'' he said.

``Hendricks' diagnosis as a pedophile, which qualifies as a `mental abnormality' under the act, thus plainly suffices for due process purposes,'' Thomas said.

Thomas' opinion was joined by Chief Justice William H. Rehnquist and Justices Sandra Day O'Connor, Antonin Scalia and Anthony M. Kennedy.

Dissenting were Justices Stephen G. Breyer, John Paul Stevens, David H. Souter and Ruth Bader Ginsburg.

Writing for the four, Breyer said the Kansas law amounts to additional punishment for Hendricks because the state did not provide treatment for him while he was in prison. The law cannot be applied retroactively to Hendricks, the justice added.

Breyer also said Kansas could classify Hendricks as mentally ill and dangerous person for civil commitment purposes. That section of his opinion was joined only by Stevens and Souter.

The Kansas law said violent sexual offenders who have completed their prison terms can be involuntarily committed if they suffer from a ``mental abnormality or personality disorder'' and are likely to commit new sex crimes in the future.

Under the law, a judge or jury must decide beyond a reasonable doubt that somebody fits that definition. Anyone committed to a mental health facility under the law is entitled to a new evaluation every year.

Five other states have similar laws: Arizona, California, Minnesota, Washington and Wisconsin.

In 1994, Kansas prosecutors invoked the law to stop Hendricks' release after he served 10 years in prison.

A psychologist testified for the state that Hendricks was not mentally ill but that he was a pedophile, which qualified as a ``mental abnormality.'' Hendricks said the only way he could guarantee he would not molest children again was to die.

A jury ruled that he was a violent sexual predator, and a judge ordered him committed to a state hospital.

But the Kansas Supreme Court ruled that the state law violated Hendricks' due-process rights because it allowed him to be committed without proof that he is mentally ill.

Hendricks remained confined in a Kansas state hospital while state officials appealed to the Supreme Court.

In 1992, the Supreme Court ruled that people acquitted of crimes because of insanity cannot be kept in mental hospitals after regaining their sanity just because they might still be dangerous.

Today, the justices reversed the Kansas Supreme Court ruling.

``A finding of dangerousness, standing alone, is ordinarily not a sufficient ground upon which to justify indefinite involuntary commitment,'' Thomas said. But, he said, the Kansas law ``links that finding to the existence of a `mental abnormality' or `personality disorder' that makes it difficult, if not impossible, for the person to control his dangerous behavior.''

The cases are Kansas vs. Hendricks, 95-1649, and Hendricks vs. Kansas, 95-9075.