An elderly North Carolina man who spent the last 40 years in prison for a double murder he did not commit will be freed, a panel of state Supreme Court judges ruled Friday.

Joseph Sledge, 70, was sentenced to life in prison following his conviction for two counts of second-degree murder in the 1976 deaths of a mother and daughter from Elizabethtown, the Associated Press reported.

But an investigation conducted by the North Carolina Innocence Inquiry Commission revealed that DNA, hair and other evidence gathered in the case had no connection to Sledge.

"The system has made a mistake," District Attorney Jon David said according to the AP. "The wrong man is in prison."

Josephine Davis and her daughter Aileen were found stabbed to death at their Elizabethtown home in September 1976, a day after Sledge escaped from a prison work farm where he was serving four years for grand larceny.

The Innocence Commission, the only state agency like it, determined there were enough holes in Sledge's case and a judge allowed for new DNA testing in 2003, WTVD reported.

It wasn't until 2010 that lab experts determined Sledge was not a match for the DNA, hair and fingerprints found at the crime scene, according to the Innocence Commission. The same conclusion came after testing in 2012, WTVD reported.

Another hole revealed in the case was the testimony of Herman Baker, who said he lied at Sledge's 1978 trial after he was promised leniency for his own drug case and said law enforcement told him what to say, according to the AP.

Baker signed an affidavit in 2013 recanting his testimony.

Sledge, who maintained his innocence these 40 years, stayed still after the three-judge panel ordered his freedom, the AP reported. He then hugged his lawyer and family members who saw their loved one finally exonerated.

His family plans on taking him to Georgia to live with his brother.