SEATTLE — A man who has been in prison for nearly two decades walked out of an Olympia courtroom as a free man Thursday, two years after his supposed victim recanted allegations that he molested her.

Jerry Lee Brock, 55, had been in prison since his conviction for first-degree molestation in 1995. In 2012, the alleged victim, Regina Rush, came forward to say she made the whole thing up, partly as a way to get more attention from her mother.

Last week, Thurston County Superior Court Judge Erik Price ordered a new trial after finding the recantation credible, and on Thursday, he signed an order vacating Brock’s conviction. The order stated that Brock “shall no longer remain in the custody of the Washington State Department of Corrections.”

“He was all smiles,” said Brock’s lawyer, public defender Patrick O’Connor. “His brother was there to pick him up and take him home. It was very satisfying to see.”

Rush was 11 years old when she accused Brock, a friend of her mother, of molesting her. She repeated the allegations at trial, and Brock was sentenced to life in prison under a “three-strikes” law; he had convictions for burglary and promoting prostitution.