Image copyright Getty Images Image caption The last execution in California was in 2006

A US federal appeal court has rejected a ruling which declared that capital punishment in California was unconstitutional.

The original judgment said long delays in executing prisoners meant the death penalty was "cruel and unusual".

The appeal court has now dismissed that ruling as legally flawed, overturning it on procedural grounds.

Separate legal arguments about lethal injections mean that executions in California remain suspended.

The latest case was brought by Ernest DeWayne Jones, who was sentenced to death 20 years ago for the rape and murder of his girlfriend's mother.

His lawyers argued that long delays in the appeals process meant that only a "random few" of those on death row were actually put to death.

More than 900 people have been sentenced to death in California since 1978 but only 13 have been executed.

A district court ruled in Jones's favour in July 2014, criticising the "dysfunctional post-conviction review process".

But on Thursday the court of appeals for the ninth circuit concluded that legal precedent meant the courts should not be considering the merits of the case.

No-one has been put to death in California since 2006 and executions will remain on hold pending separate legal arguments about whether lethal injections are constitutional.