A federal judge has ruled that California's use of the death penalty is dysfunctional and violates the constitutional prohibition against cruel and unusual punishment.

U.S. District Judge Cormac Carney's ruling came in response to an appeal by Ernest Dewayne Jones, who was sentenced to death in Los Angeles in 1995 for the rape and killing of his girlfriend's mother three years earlier.

Carney noted that the death penalty has been imposed more than 900 times since 1978, but only 13 of those prisoners have been executed.

Carney, who was appointed by President George W. Bush, wrote that Jones was far from alone in waiting decades to find out when and whether he would be put to death.

Such uncertainty and systemic delays are unconstitutional, he decided. Carney wrote that "the random few" who are put to death wait so long to face execution that capital punishment serves "no retributive or deterrent purpose.

"No rational person 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," Carney wrote.

California hasn't carried out an execution since 2006, when a federal judge found flaws in the state's system of lethal injection.

But Wednesday's ruling marked the first time a federal judge found California's current death penalty system unconstitutional, Natasha Minsker, an ACLU director in Northern California, told the Los Angeles Times.

She also said it was "the first time any judge has ruled systemic delay creates an arbitrary system that serves no legitimate purpose and is therefore unconstitutional."

Use of the death penalty has been in decline in recent years, owing to widespread problems with lethal injections as well as juries' more often choosing life sentences without parole as a punishment.

Six states have abolished the death penalty over the past seven years. California voters, however, rejected a ban on executions in 2012.

Supporters of the death penalty questioned Carney's logic in deciding that long delays imposed a burden on convicted killers.

"It's wrong," says Kent Scheidegger, legal director for the Criminal Justice Legal Foundation, a death penalty advocacy group based in Sacramento.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.