A Virginia appeals court declared Thomas Haynesworth an innocent man Tuesday, clearing his name and acknowledging that he spent 27 years behind bars for rapes he did not commit.

It is the first time the state has issued a “writ of actual innocence” in a rape case without the certainty of DNA evidence. Haynesworth, 46, was supported by Attorney General Ken Cuccinelli II (R) and two state prosecutors — all of whom concluded that he was mistakenly identified by a rape victim as he walked to a Richmond market for sweet potatoes and bread one February afternoon in 1984.

“It’s a blessing,’’ Haynesworth said as he stood with his attorneys and Cuccinelli. “There are a lot of people behind the scenes who believed in me. Twenty-seven years, I never gave up. I kept pushing. I ain’t give up hope.

“I am very happy. Me and my family can finally put this behind us, and I can go on with my life. And I can finally vote.”

The case shows how far Virginia has come in allowing convicts to argue their innocence. Historically, prisoners were barred from introducing new evidence more than three weeks after sentencing, and in the 1990s, then-Attorney General Mary Sue Terry (D) famously said, “Evidence of innocence is irrelevant.” But when DNA testing resulted in hundreds of exonerations nationwide, it prompted Virginia lawmakers to open the door for courts to reconsider guilt based first on genetic evidence and later on other evidence, such as recanted testimony, fingerprints or ballistics.

Although Haynesworth was released on parole in March, he has not been fully free. Now, his photo has been taken off the state’s sex offender registry. He is allowed to use the Internet. Finally, he can take a woman on a date without first introducing her to a parole officer.

“I have never heard him this excited, including the day he was released from jail,” said Shawn Armbrust, one of his attorneys and director of the Mid-Atlantic Innocence Project. “Everybody, the law and the government, says he did not do this. Before there was always an asterisk.”

Despite the support of law enforcement, Haynesworth’s exoneration was far from guaranteed. Four of 10 Virginia Court of Appeals judges opposed granting the writ.

“The victims have not recanted, no one has confessed, and there is no direct evidence that Haynesworth did not commit these crimes,” Judges Larry G. Elder and William G. Petty wrote in a dissenting opinion. “The Attorney General has merely expressed his opinion that Haynesworth is innocent.”

Haynesworth was 18 when he was arrested as he headed to the market to buy groceries for Sunday dinner. A woman who had been attacked days earlier spotted him and told a police officer that he was the assailant.

Haynesworth told police that they had the wrong man. But five women ultimately identified him as their attacker. He was convicted in three attacks and acquitted in one; one case was dropped.

For years, Haynesworth languished in prison. He earned his GED and studied auto mechanics, welding and masonry.

But he never gave up trying to prove his innocence. When he came before the parole board he didn’t apologize — despite advice from fellow inmates that it might earn him an early release, he said. He wrote letters to “60 Minutes,” local newspapers and law students asking for help.

A turning point came in 2005 when the exonerations of five wrongly convicted men prompted then-Gov. Mark R. Warner to order a sweeping review of thousands of cases with DNA evidence. Haynesworth’s case was among them.

Using technology that wasn’t available in the 1980s, authorities tested semen collected in a January 1984 rape for which Haynesworth had been convicted. It cleared him and pointed to a convicted rapist named Leon Davis.

The Innocence Project took on Haynesworth’s case, and DNA was tested in another rape case in which Haynesworth was a suspect. Again, he was cleared, and Davis, who is serving a life sentence for different crimes, was implicated.

Haynesworth’s attorneys were convinced that Davis, who lived in the same neighborhood and resembled Haynesworth, was the sole attacker. But in the two remaining cases, there was no genetic evidence to test.

Virginia prosecutors agreed to delve back into the case. During a months-long investigation, authorities re-interviewed Haynesworth and the victims and re­examined the files. Haynesworth passed two polygraph examinations. In the end, prosecutors were also convinced that all the victims had identified the wrong man.

But it is not easy to overturn such convictions.

Before Tuesday, the Virginia Court of Appeals had only once exonerated a convict in a case that didn’t involve DNA evidence, clearing a man of a weapons charge after he showed that he had a gas gun, not an actual firearm. The court had denied more than 180 such claims.

“It’s much harder when you don’t have the smoking gun of DNA,” said Peter Neufeld, an Innocence Project co-founder who worked on the Haynesworth case. “This is the very first time in the history of the Innocence Project where the attorney general and two local prosecutors joined us in seeking an exoneration, yet it nevertheless took nine months, two trips to the Court of Appeals and six judges to ensure the relief that was obvious to everyone.”

One of the victims, who had become convinced that she was mistaken, said she is “extremely happy” he has been cleared. “It has been a long time coming,” she said. “He is an in­cred­ibly strong person, and I wish him the best.”

As Cuccinelli, who had hired Haynesworth to work in his mailroom, announced the ruling in an emotional news conference, dozens of his staff members broke into applause and gave Haynesworth a standing ovation.

“An attorney general’s job is not convictions when it comes to law enforcement. It’s justice,’’ Cuccinelli said. “Today we got justice. . . . I have never experienced the pure joy of today’s outcome.”

Haynesworth said he plans to keep his mailroom job but someday hopes to open his own mechanics shop. Cuccinelli took Haynesworth to lunch Tuesday at the Tobacco Company, a restaurant a few blocks away in historic Shockoe Slip. And Haynesworth said his three sisters planned to take him to dinner.

“I’m just so happy,” Haynesworth said. “You just want your name restored. You want to prove to them that they made a mistake.”

Glod reported from Washington.

Read more on PostLocal.com:

Pearl Harbor veteran recalls chaos

Key evidence thrown out in Keith Little murder trial

D.C. Council backs tougher ethics rules

Johnson sentenced to 7 years for graft