Updated

A U.S. citizen jailed for nearly two years on money-laundering and drug charges in Nicaragua will be freed after a court unanimously upheld his appeal, his lawyer said Wednesday.

Attorney Fabbrith Gomez said the appeals court vacated the charges against Jason Puracal, 35, of Tacoma, Washington, and ordered him released immediately.

"We are happy, everyone that worked for this is happy," he said.

Gomez said it could be a matter of hours or days before the American who worked as a real estate agent in Nicaragua is released from the prison right outside Managua, the capital. He said the three-judge panel also ordered the release of the other defendants in the case.

The court was supposed to have announced its ruling by Sept. 4, according to Nicaraguan law, but Gomez said he wasn't notified until Wednesday.

Eric Volz, managing director for the Los Angeles-based David House Agency that helped Puracal file petitions and publicize the case, said the order for his release had not been handed over to the prison.

"The family is thrilled to hear the news that they are another huge step closer to bringing Jason home," Volz said in an emailed statement. "There is one thing we have known all along over the past two years: Jason is innocent. The annulment of the oral and public trial is testament to this fact."

Details of the decision to free Puracal were not immediately available. There was no immediate confirmation from court officials.

Gomez had argued to the appeals court that Puracal's home sales were legitimate business deals and were not related in any way to drug traffickers.

The University of Washington graduate made the Pacific coast surfing town of San Juan del Sur his home after a two-year stint in Nicaragua with the Peace Corps. He married a Nicaraguan woman and they had a son with Down syndrome in March 2007.

Puracal was featured in a 2007 episode of HGTV's "House Hunters International" showing beachfront homes to Americans. The same year he got a Re/Max real estate franchise with three other Americans living in Nicaragua.

On Nov. 11, 2010, masked policeman carrying AK-47 assault rifles raided his real estate office and took him to Nicaragua's maximum-security prison. Prosecutors charged that Puracal was using his business as a front for money laundering in a region used to transport cocaine from Colombia to the United States.

He was convicted in August 2011 of all charges and later sentenced to 22 years in prison.

Puracal's family and friends and human rights groups maintained the charges were false. Seeing the case marred with inconsistencies, U.S. lawmakers supported Puracal by sending letters to Secretary of State Hillary Rodham Clinton and Nicaraguan President Daniel Ortega asking to intervene.

Defense attorneys complained the judge who convicted Puracal and 10 other defendants was not fully certified with Nicaragua's Supreme Court and had just been appointed.

Gomez also said that if authorities had been building a strong case against Puracal years before his arrest, as they claimed, he wouldn't have obtained his residency from the Nicaraguan government days before the arrest.

The U.N. Working Group on Arbitrary Detention had ruled that Puracal should have been freed because he had not received a fair trial and was arrested illegally in a raid conducted without a warrant.

Puracal's family claimed that he was suffering from unsanitary conditions at La Modelo prison and was denied food, drinking water and medical care. They said he lost more than 40 pounds before he was moved earlier this year to solitary confinement.

The David House Agency helped Puracal's family navigate international justice. Volz, the founder, was convicted in Nicaragua of the 2006 strangling death of his ex-girlfriend but absolved by an appeals court and released from prison.

___

Associated Press writer Adriana Gomez Licon reported this story from Mexico City and Luis Manuel Galeano reported in Managua.

___

Adriana Gomez Licon is on Twitter http://twitter.com/agomezlicon