A federal judge has decided that the death penalty system in California is unconstitutional.

On Wednesday, U.S. District Judge Cormac J. Carney ruled that the system has created extensive delays and uncertainty for inmates, most of whom will never be put to death. As a result, he found that the state's death penalty is arbitrary and violates the U.S. Constitution's ban on cruel and unusual punishment.

"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, according to the Los Angeles Times.

He noted that out of over 900 inmates placed on death row in California since 1978, only 13 have been executed so far. Meanwhile, the last execution took place in 2006, reports the New York Times.

According to Carney, 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," he wrote.

He also ruled on a petition by death row inmate Ernest Dewayne Jones, who was sentenced to capital punishment in 1995 for raping and killing his girlfriend's mother, after being paroled for a previous rape.

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," wrote the Orange County judge.

"For all practical purposes then, a sentence of death in California is a sentence of life imprisonment with the remote possibility of death -- a sentence no rational legislature or jury could ever impose," Carney writes, according to The Huffington Post.

"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," he added.