At issue was whether state laws mandating harsh sentences for three-time felons amounted to cruel and unusual punishment.

Justices ruled on two separate cases involving California's then-novel 1994 law, which provides for mandatory prison terms of 25 years to life for career criminals convicted for the third time of a felony. Because of a legal twist, the law can result in offenders with prior criminal records being put behind bars for life for non-felony offenses such as petty theft and shoplifting.

Gary Ewing is serving 25 years to life for stealing golf clubs from a Los Angeles country club. In his case, the prosecutor had the option of charging Ewing with a misdemeanor but chose to try the case as a felony. The state supreme court had rejected Ewing's appeal of his sentence. His lawyer said Ewing has AIDS and expects to die soon.

In a 5-4 decision, justices said states should have the discretion to keep repeat offenders behind bars. "When the California legislature enacted the three-strikes law, it made a judgment that protecting the public safety requires incapacitating criminals who have already been convicted of at least one serious or violent crime," said Justice Sandra Day O'Connor, writing for the majority.

O'Connor admitted Ewing's "sentence is long, but so is his criminal history."

In his dissent, Justice Stephen Breyer noted, "Ewing's sentence is, at a minimum, two to three times the

length of sentences that other jurisdictions would impose in similar circumstances." In an indication of the ideological divide between the justices, Breyer read his dissent from the bench, a rare move usually reserved for only the most contentious cases.

In the other case, Leandro Andrade was given a 50-year sentence in 1995 for stealing videotapes in two southern California stores. While in most cases the crime would have been a misdemeanor, Andrade's prior felony burglary convictions turned it into a felony, his third.

The justices reversed a federal appeals court which found the sentence "grossly disproportionate," violating the Eighth Amendment's ban against cruel and unusual punishment.

The "three-strikes" law was passed in 1994, after a voter referendum got 71 percent support. The ballot measure was prompted by the 1993 abduction-murder of 12-year-old Polly Klaas in Petaluma, California. The killer, Richard Allen Davis, was a twice-convicted kidnapper who had been on parole after serving only half of a 16-year prison term for the second kidnapping. Davis remains on California's death row.

The federal government and 26 states have a three strikes-type law, imposing as much as a life prison term for criminals convicted of a third felony.

California's law requires prisoners to serve their full sentences before applying for parole. The number of current three-strike prisoners in that state has grown to about 7,100.

Supporters of the measure hoped the tough sentencing law would send a message to career criminals and give so-called "lenient" judges less discretion in sentencing.

Opponents say violent crime has not been reduced because of the law, and crimes normally prosecuted as misdemeanors should be not be allowed to put a person away for life in prison. They claim about 350 prisoners are currently in the same situation as Andrade and Ewing.

The Supreme Court in the 1980s split on the issue of life sentences for minor, non-violent felonies, in cases in Texas and South Dakota. And in 1991, justices upheld a life sentence for a Michigan man with no prior criminal record accused of possessing 1.5 pounds of cocaine.