A Texas man has admitted to setting a backyard fire in 1986 that killed his two stepsons, ending a yearslong fight over whether faulty fire science had wrongfully put him behind bars.

In a surprising twist, Ed Graf pleaded guilty Tuesday to two counts of murder just as a jury in Waco was deliberating during his retrial. He was originally convicted in 1988 of setting the fire, but he was given a new trial after experts raised questions about the testimony of fire investigators at his first trial.

The Waco Tribune-Herald reports that his plea agreement calls for a sentence of 60 years in prison. Graf has served 28 years behind bars and will be eligible to apply for parole immediately.

Graf had maintained his innocence for years.