A 69-year-old man who has spent 36 years behind bars for murder was wrongly convicted and could be released after a court hearing next week, prosecutors in southern California said.

The Ventura County district attorney’s office announced on Tuesday that new evidence resulted in a judge overturning the conviction of Michael Hanline.

He was found guilty in 1980 of first-degree murder over the death two years earlier of Ventura resident JT McGarry. Hanline was sentenced to life in prison without the possibility of parole.

New DNA testing of crime scene evidence revealed material that came from a man who was not Hanline or his alleged accomplice, contradicting the prosecution’s theory presented during the trial.

In addition, evidence that should have been disclosed to Hanline during the trial was withheld from him.

Michael Schwartz, a special assistant district attorney, said “flaws in the trial and the totality of evidence cast sufficient doubt to warrant vacating the jury’s guilty verdict”.

Hanline is currently housed at Solano state prison in Vacaville. He is expected to be released following a court hearing on 24 November.

The DA’s office will conduct an investigation and decide whether to retry him. Schwartz said that while Hanline’s conviction is vacated, prosecutors “have not concluded that he’s factually innocent”.

The California Innocence Project, which took up the case in 1999, says Hanline’s case was the longest wrongful incarceration in state history.

“It’s amazing that Mike will finally be released after 36 years of wrongful incarceration,” said Justin Brooks, the director of the project at California Western School of Law. “It’s time for him to get back to his family and his life.”