RALEIGH, N.C. (AP) — North Carolina judges have vacated a second-degree murder conviction after finding that prosecutors violated double-jeopardy principles when they tried the defendant a second time.

The state Court of Appeals ruling Tuesday throws out the guilty verdict against James Harold Courtney.

Courtney's first trial in the 2009 shooting death of James Deberry ended with a deadlocked jury and mistrial. Prosecutors later dismissed the murder charge, citing the hung jury.

However, Courtney was indicted again in 2015 and convicted based on new evidence. He was sentenced to approximately two decades in prison in the shooting that authorities say was drug-related.

The appeals court said that while a defendant can be retried after a mistrial, the prosecutor's dismissal of the charge after Courtney's first trial was binding and conclusive.