An Illinois man who spent more than two decades in prison for a murder conviction obtained with shoddy ballistics evidence is getting a chance to prove his innocence with a new trial.

The retrial of Patrick Pursley in the April 1993 killing of 22-year-old Andy Ascher is set to begin Thursday in Rockford, where Ascher was fatally shot during a robbery while sitting in a car with his girlfriend.

Pursley, 53, was convicted in Ascher's death in 1994 based mostly on ballistics analysis that was once thought to infallible but is now considered antiquated.

Five years after he went to prison, though, a much more accurate approach emerged called the Integrated Ballistic Identification System, or IBIS, which uses much higher-resolution and multi-dimensional images for ballistics analysis. For years, while representing himself in prison, Pursley pushed for the evidence in his case to be retested using IBIS, and in 2007, his efforts persuaded Illinois lawmakers to pass the nation's only law requiring such retesting when inmates appealing their convictions request it.

When the evidence in Pursley's case was retested with IBIS, it showed that the scratches and dents on bullets and shell casings from the crime scene didn't match the gun that prosecutors presented at trial as the murder weapon. In March 2017, Judge Joseph McGraw ordered Pursley retried on a first-degree murder charge and allowed him to go free on bail.

A month after McGraw ordered the retrial, the victim's mother, Lois Ascher, informed prosecutors that a detective told her after Pursley's first trial that police never found the murder weapon and that another gun was entered as evidence. But prosecutors didn't inform Pursley's new defense attorneys about Lois Ascher's assertion until right before his retrial was supposed to begin, in November 2018.

The retrial was delayed while Pursley's attorneys argued for his case to be dismissed, accusing prosecutors of misconduct for not revealing potentially exculpatory evidence. However, McGraw declined to dismiss the case, calling Lois Ascher's assertion "uncorroborated hearsay" and saying he didn't think prosecutors acted in bad faith even though they "willfully failed" to immediately tell the defense about the detective's supposed statement.

The gun and shell casings were the only physical evidence prosecutors used to convict Pursley. Pursley's girlfriend at the time of the killing implicated him in the crime but later recanted, saying her testimony had been coerced. Prosecutors also relied on testimony from a man who received a Crime Stoppers reward for telling police that Pursley had confessed to the crime.

Lawyers from Northwestern University's Center on Wrongful Convictions and the Chicago-based firm Jenner and Block will represent Pursley free of charge at the retrial. McGraw — not a jury — will decide the verdict, at Pursley's request.

Katie Zimmerman, a spokeswoman for the Winnebago County State's Attorney's Office, said her office couldn't discuss the case because it is pending.

Since his release on bail, Pursley has been busy speaking out about wrongful convictions and gang violence. He also started a nonprofit dedicated to encouraging young people to go to college and avoid a life of crime and he built a recording studio in his basement to develop a talent agency for urban youth interested in music.

"I believe justice will be done," Pursley told The Associated Press by phone on Tuesday. "Of course, it's not in my hands and it's a chance — you never know what will happen."