Panama's ex-president Ricardo Martinelli was acquitted on Tuesday in a trial for alleged espionage against opponents of his government when he was in power between 2009 and 2014.

It is the second time the former Panamanian leader has been acquitted on such charges.

He was also accused of embezzling public funds to spy on his opponents when he led the country, and the prosecution accused him of wiretapping more than 150 people, including politicians and journalists.

But the court ruled that the prosecution's evidence against Martinelli was insufficient.

"Justice, finally, was applied," Martinelli, 69, said as he left the court.

"Seven years of this torture. I thank God and the Panamanian justice system. I suffered a lot."

The former Panamanian leader was accused of embezzling public funds to spy on his opponents when he was in power
The former Panamanian leader was accused of embezzling public funds to spy on his opponents when he was in power AFP / Luis ACOSTA

Carlos Herrera Moran, a lawyer for one of the victims of the alleged wiretapping, said the decision was "outside the law and the evidence presented."

Martinelli was acquitted of similar charges in 2019 but that was overturned last year, forcing a new trial in July.

He was first tried after being extradited from the United States in 2018, where he had resided for several years and evaded Panamanian justice.

The billionaire supermarket tycoon rose to the presidency in 2009 after winning an election campaign in which he gave a speech denouncing corruption and the country's political class.

He was later named in the "Pandora Papers" investigation into the creation of offshore shell companies meant to hide money in tax havens, but denied involvement in anything untoward.