The former president was on trial for spying on opposition and embezzling US$45 million from the federal school lunch program.
A Panamanian criminal court ruled former president Ricardo Martinelli not guilty of charges that he spied on 150 people, including politicians, union leaders and journalists during his 2009-2014 presidency, and ordered his release.
According to the verdict read by one of the three judges involved, prosecutors "failed to prove" their theory and "reasonable doubts arose" about the accusations presented.
"The trial court considers that Mr. Ricardo Martinelli is not guilty of the crimes accused ... and the precautionary measure against him is lifted and his immediate freedom is ordered," Judge Raul Vergara read in the courtroom, according to EFE.
The once-Panamanian president, Martinelli, has also been accused of embezzling US$45 million from Panama's federal school lunch program.
Martinelli thanked his lawyers to reporters after his not-guilty verdict was announced.
Earlier Friday, it was reported that evidence provided by Panamanian Public Prosecutor Ricaurte Gonzalez gave weight to the allegations and the prosecutor filed a request that the court rule and make an example of Martinelli by delivering a 21-year sentence for his violation of privacy.
"The time has come to change history," Gonzalez insisted as the hearing wound down Thursday.
According to Panama America media, Martinelli said at closing remarks Aug. 8, "Here I am the victim ... I never gave an order in the National Security Council to follow anyone; I never used the resources of the state to commit any wrongdoing," the ex-president said on entering court Friday.
This was the first time a Panamanian president has been tried in a criminal court. Martinelli previously attempted to avoid the event by escaping to the U.S. in 2015. He was extradited in 2018 and held in a pretrial detention for the year before being released on house arrest last June when the trial began.