Gov. Terry McAuliffe has pardoned a Virginia man who has spent 29 years in prison for an attempted rape that Richmond's chief prosecutor and others say he didn't commit.

Wednesday's pardon comes five days before a scheduled hearing that could have resulted in Michael McAlister being held indefinitely under Virginia's civil commitment law for treatment as a violent sex offender.

McAuliffe said in a written statement that overwhelming evidence shows McAlister is innocent.

McAlister was convicted of the February 1986, abduction and attempted rape of a woman who was dragged at knifepoint from an apartment complex laundry room. The victim identified McAlister as the attacker from a photo lineup that did not include a picture of a serial rapist who is now believed to be the real perpetrator.