California’s death penalty violates the U.S. Constitution’s ban on cruel and unusual punishment, a federal judge ruled in a case that could work its way up through the court system.

U.S. District Judge Cormac J. Carney ruled Wednesday on a petition by death row inmate Ernest Dewayne Jones, who was sentenced to die nearly two decades ago.

The ruling can be appealed to the U.S. 9th Circuit Court of Appeals. A spokesman for Atty. Gen. Kamala D. Harris said only that her office was reviewing the decision.

“I think it has a shot in the 9th Circuit, but I don’t know about the U.S. Supreme Court,” said Santa Clara University law professor Gerald Uelmen, who chaired a state commission that concluded the system needed substantially more money to operate effectively.

“It is conceivable that the U.S. Supreme Court and the 9th Circuit could say California is such an outlier — its system is so dysfunctional, with twice the national delay — that it cannot be sustained,” Uelmen added.

Carney said the state’s death penalty has created long delays and uncertainty for inmates, most of whom will never be executed.

He noted that more than 900 people have been sentenced to death in California since 1978 but only 13 have been executed.

“For the rest, the dysfunctional administration of California’s death penalty system has resulted, and will continue to result, in an inordinate and unpredictable period of delay preceding their actual execution,” Carney wrote.

Carney, an appointee of former President George W. Bush, said the delays have created a “system in which arbitrary factors, rather than legitimate ones like the nature of the crime or the date of the death sentence, determine whether an individual will actually be executed,” Carney said.

In overturning Jones’ death sentence,  Carney noted that the inmate faced “complete uncertainty as to when, or even whether" he will be executed.

The “random few” who will be executed  “will have languished for so long on Death Row that their execution will serve no retributive or deterrent purpose and will be arbitrary,”  Carney said.

“No rational person,” Carney wrote, “can question that the execution of an individual carries with it the solemn obligation of the government to ensure that the punishment is not arbitrarily imposed and that it furthers the interests of society.”

Natasha Minsker, a director of the ACLU of Northern California, said Wednesday’s ruling marked the first time that a federal judge had found  the state’s current system unconstitutional. She said it was also “the first time any judge has ruled systemic delay creates an arbitrary system that serves no legitimate purpose and is therefore unconstitutional.”

A Los Angeles County Superior Court judge in 1995 sentenced Jones to death for the 1992 rape and killing of Julia Miller, his girlfriend’s mother. Jones killed Miller 10 months after being paroled for a previous rape.

Follow @mauradolan for news about California legal issues.