A Louisiana man has been freed from prison after spending 36 years behind bars for a rape he did not commit.

Archie Williams, 58, was convicted of raping and stabbing a woman in her home in Baton Rouge in 1982.

He was 22 at the time and was convicted after the white victim identified him in a line-up of other people.

It was the third time she had seen his face after being shown photographs of him by police on two occasions beforehand.

Archie Williams, 58, is pictured leaving court on Friday in Baton Rouge, Louisiana, after spending 36 years in prison for a crime he did not commit

Williams holds up a t-shirt with the word Justice on it outside Baton Rouge court on Thursday

Williams hugs his family outside the court on Thursday. He said he was happy to be free but dismayed over the number of people still unfairly locked up

Williams, who was in fact at home sleeping at the time of the murders, was sentenced to life without the possibility of parole but has been fighting to have his conviction overturned.

On Thursday, it was vacated after police matched fingerprints found at the scene to those of serial rapist Stephen Forbes.

They achieved the match by running the prints found at the rape scene through the FBI's national fingerprint database.

Prosecutors for years refused to run the search, claiming he had no statutory right to it.

It was not until Commissioner Kinasiyumki Kimble of the 19th Judicial District Court ordered that it be carried out this month that the truth was finally revealed.

If they had done it sooner, they would have found that the fingerprints belonged to Forbes and could have potentially stopped him from going on to attack other women.

It now remains uncertain if he will file legal action against the state for compensation.

On Thursday, a prosecutor apologized to Williams in court for the decades he has spent wrongfully incarcerated.

'This is the right, honest, ethical and now factual thing to do.

'You are factually innocent, wrongfully convicted, and on behalf of the state, we apologize that you have suffered this,' East Baton Rouge District Attorney Hillary Moore III said.

The man was joyful as he celebrated outside the courthouse with his family but said he was pains over the thought of others still being in jail when they should not be.

'I'm not free until they're free,' he said.

Williams was 22 when he was caught up the investigation. It is not clear why police suspected him initially.

Williams was jubilant but also saddened, he said, by the number of men who remain wrongfully convicted

The 58-year-old and his lawyers from The Innocence Project walk out of court on Thursday. He was exonerated by fingerprints found at the scene which belonged to another man but which prosecutors refused to test for years

The attack happened at night and involved Forbes breaking in to the woman's house and raping her in her bedroom.

When a neighbor entered the home, he stabbed them then fled.

Both the neighbor and the victim gave descriptions to the police of the attacker which made him taller than Williams.

They were also both shown photo line-ups that included Williams in them but did not pick him on more than one occasion.

It was not until they had been shown his face several times already that they fingered him as the attacker.

He was convicted by a jury, despite his family testifying that he was at home asleep on the night of the attack, and was sentenced to life imprisonment without parole.

Williams is shown with his sisters in prison. He first contacted The Innocence Project in 1995

In 1995, 13 years into his sentence, Williams contacted The Innocence Project and asked its lawyers to take his case.

Since then, they have been fighting to have all the DNA evidence from the scene and the fingerprints tested.

In addition to the victim labeling Williams as her attacker, prosecutors convinced the jury of his guilt by saying that his DNA matched a sample of semen found at the scene.

It could have in fact belonged to dozens of different men and was not an individual match.

For years, the Innocence Project's lawyers have pleaded with state authorities to let them run fingerprints found at the scene through the FBI's national database which was modernized in 2014 to become more reliable.

Prosecutors, however, refused on the grounds that Williams had no statutory right to it.

His lawyers fought their case through the courts and, earlier this month, a judge ordered that they run the prints.

They were a hit for Forbes who died in prison in 1996.

He was arrested in 1986 while trying to rape someone else, two miles away from the home where he attacked the woman Williams was accused of raping.

Forbes confessed then to four other rapes which happened after Williams was jailed.

The Innocence Project celebrated Williams' release on Thursday but is calling for it to be mandated that prisoners get access to any and all DNA and finger print tests which could exonerate them.

'Mr. Williams first wrote to the Innocence Project for help in 1995. He was 35 years old.

'Today, he walked out of prison at age 58. There is no way to quantify the loss and pain he has endured.

The Innocence Project fought alongside Mr. Williams for close to two and a half decades to be able to utilize advancements in forensic testing to prove his innocence.

'Once a person is convicted, the criminal laws are rife with vast, insurmountable procedural hurdles intended to favor finality over truth. While we have come a long way in allowing convicted people access to evidence for DNA testing, we have a long way to go when non-DNA evidence of innocence is at issue.

'Given what we now know about wrongful convictions, that they occur at alarming rates, we must create pathways for truth to prevail,' said Vanessa Potkin, director of post-conviction litigation.