By Ashley Fantz, CNN

An American who has been imprisoned for nearly two years in Nicaragua will be freed Thursday, and all the charges he was convicted of will be vacated, according to members of his legal team and a judicial order they gave to CNN.

Jason Puracal, a 35-year old native of Washington state, had been serving a 22-year sentence for drug-related crimes in one of the Latin American country's most notorious prisons. He is one of 12 people ordered freed.

Since his arrest in 2011, Puracal had many vocal defenders who said the charges were baseless and there was not a shred of evidence presented at his trial to support the charges. Those defenders included prominent human rights activists, renown international attorneys, a former FBI investigator and a U.S. congressman.

Why defenders believe Puracal is innocent

As his attorneys got word of the release order, it was unclear if Puracal was aware that he was to be a free man, said his attorney Jared Genser.

“We are trying to get word to Jason, but it’s after hours in the prison,” he said. “But we can say this is very, very good news, and we’re pleased that justice can be had in Nicaragua.”

In August, Puracal spoke by phone with CNN’s Anderson Cooper, saying he has been imprisoned in a “hellhole” and that he was “100 percent innocent.”

“I don't know the reason that I'm here," Puracal said. "That's been a mystery from the very beginning. What the motives behind the police and the prosecution have been."

Wednesday’s order from the court was the result of an appeal hearing that concluded earlier this summer in which Puracal’s legal team argued for his release.

"The family is thrilled to hear the news that they are another huge step closer to bringing Jason home. There is one thing we have known all along over the past two years: Jason is innocent," said Eric Volz, a spokesman for Puracal's family

Watch Anderson Cooper 360° weeknights 8pm ET. For the latest from AC360° click here.