Justin Michael Wolfe, whose capital murder conviction and death sentence were reversed amid concerns about prosecutorial misconduct, pleaded guilty to murder in Prince William County on Tuesday, admitting in a handwritten statement that he and another man plotted the 2001 robbery and slaying of a fellow marijuana dealer.

It was a stunning reversal from Wolfe, who had proclaimed his innocence for 15 years. Wolfe had argued, at times from Virginia’s death row, that the murder of Daniel Petrole Jr., the son of a decorated Secret Service agent, was the work of a rogue drug associate. The case featured a co-defendant repeatedly changing his story about the slaying, a federal district judge ordering Wolfe’s release from jail in 2012, and two federal courts chastising Prince William prosecutors for withholding evidence from the defense.

Wolfe pleaded guilty to a charge of first-degree felony murder, use of a firearm, and a drug charge, part of an agreement with prosecutors that will allow a judge to sentence him to a range of 29 to 41 years in prison. He will get credit for the 15 years he already has served.

In a four-page handwritten statement to the court, Wolfe essentially validated the prosecution’s consistent version of events: Wolfe and Owen Merton Barber IV decided to rob and kill Petrole because they knew he would have a large amount of cash and marijuana and feared that a robbery alone would invite revenge. Wolfe acknowledged that he owed Petrole tens of thousands of dollars from continuing drug transactions, and he said that he had planned to split the proceeds with Barber and erase a debt Barber owed him.

The statement, dated March 19, 2016, addresses Petrole’s parents, and concludes: “I am sorry for what I did to your son.”

Wolfe entered his plea Tuesday morning before Prince William County Circuit Court Judge Carroll A. Weimer Jr., and he is scheduled to be sentenced on July 20. It is the first time Wolfe has taken responsibility for the slaying; he had always maintained that it would make no sense for him to kill his marijuana supplier, and his lawyers argued that Barber carried out the robbery and slaying on his own.

Wolfe wrote that he and Barber initially planned only to rob Petrole, as he delivered a marijuana shipment to them, but “eventually we both agreed that it would be necessary to kill Danny because he was probably going to resist the robbery or figure out who did it and have to get revenge. … I am responsible for Danny’s death even though I didn’t pull the trigger. If I had not been involved Danny would never have been killed.”

Petrole, 21, was found shot to death in front of his Bristow townhouse in March 2001. Wolfe, then 20, and Barber, then, 22, former classmates at Chantilly High School, were soon arrested. Barber agreed to plead guilty and testify that Wolfe had ordered up the slaying of Petrole, in exchange for a relatively light sentence — he received 38 years in prison. Prosecutors sought the death penalty for Wolfe, and a jury imposed it in January 2002, disbelieving Wolfe’s testimony denying any connection to the murder.

The killing helped Prince William County police uncover what was then one of the most significant drug operations in the region’s history, leading authorities to an extensive network of suburban teenagers and young men who sold high-grade marijuana and ecstasy to thousands of customers throughout Northern Virginia — most of them high-schoolers.

Though Wolfe all along admitted his role in the drug trade and his extravagant, free-wheeling lifestyle, Wolfe maintained his innocence in the murder. Then in 2005, Barber filed an affidavit saying he had lied in court, and Wolfe hadn’t ordered the murder. In 2006, Barber took the witness stand during one of Wolfe’s appeal hearings and reversed himself again, saying Wolfe did order the murder.

Finally in 2011, after Wolfe had spent nine years on death row, a federal judge in Norfolk ordered a new trial, saying Prince William prosecutors withheld or ignored crucial evidence and potential testimony that could have helped Wolfe’s defense. U.S. District Judge Raymond A. Jackson wrote that the government’s case against Wolfe was “tenuous” and accused prosecutors of having “stifled a vigorous truth-seeking process in this criminal case.” A federal appeals court upheld Jackson in 2012, and Jackson ordered Wolfe released, before the appeals court stayed that order.

Prince William Commonwealth’s Attorney Paul B. Ebert and top assistant Richard A. Conway stepped aside amid the scrutiny, and Fairfax County Commonwealth’s Attorney Raymond F. Morrogh stepped in, over defense objections that he was too close to Ebert. The case resumed, with Morrogh saying he would again seek the death penalty for Wolfe.

Wolfe went through numerous attorneys, including representation by the Virginia Innocence Project, before being appointed defense lawyers Joseph Flood, Daniel Lopez and Bernadette Donovan. They apparently launched plea negotiations with Morrogh, and Wolfe wrote the statement admitting his role in Petrole’s murder. The plea session itself was not publicized and was not attended by the media.

“Justin entered a guilty plea today in order to take responsibility for his crime and to give the Petrole family and his own family some finality if not closure,” Flood said. “The plea offer extended by the Special Prosecutors last week was the result of long negotiations and was the first time since the inception of this case that he was ever offered a plea. Mr. Wolfe understands that he cannot take back this tragedy or make up for the pain he has caused, but is hopeful that by admitting and apologizing for what he did and bringing these proceedings to an end, he may help Danny’s family to heal.”

Wolfe’s letter said that he had been receiving large marijuana shipments from Petrole for some time, and that in the months prior to March 2001, Petrole had “fronted” him the drugs, not requiring immediate payment. Then, he wrote, “Owen asked if he could rob him for the money and marijuana. At first I played it off as a joke but Owen took it serious and I agreed that it would be okay.” Wolfe then describes Petrole delivering the marijuana, alerting Barber to Petrole’s location, and staying in touch with him before and after the shooting, later meeting him at a bar. Barber later testified that he followed Petrole for 30 miles before shooting him to death outside of Petrole’s townhome.

“Maybe it seems easy for me to say ‘I’m sorry,'” Wolfe wrote, “but it’s actually the hardest thing I have ever done because it means I have to admit what I did which contradicts what I said and trial and the position that I have taken for all of my appeals and I am very afraid that I will let the people I love down.”

Morrogh said the defense team showed him the letter and that he spoke to Petrole’s father, who conferred with the rest of his family.

“They were interested in bringing the case to a conclusion. They were really interested in him admitting what he did,” Morrogh said. Morrogh said the plea and sentence range was “a fair compromise given the evidence in the case. … No one’s completely happy, it’s fair to say, and the Petroles feel they’re going to get some good measure of justice in the case.”

The plea ensures that Wolfe will not face the death penalty in the case; under Virginia’s sentencing rules, Wolfe would be eligible for release in approximately 10 to 20 years, or in his late 40s or early 50s, depending on the judge’s sentence.