Niger's appeals court has dropped all corruption charges against ousted President Mamadou Tandja and ordered his release from jail.
It said that under the country's law it was not possible to try a head of state after he had left office.Soldiers led the coup in February 2010 - angered that after 10 years in power, he was seeking a third term in office.
Last month, the junta officially handed power to opposition leader Mahamadou Issoufou, who won an election in March.
"All proceedings against Mamadou Tandja have been cancelled. He has been wholly exempted from the accusations against him," one of his lawyers, Souley Oumarou, told the AFP news agency.
Mr Tandja was accused of embezzling state funds worth $1m (£670,000).
He was also linked to a corrupt fertilizer deal worth between $9m and $10m.
The court said it would have able to hear the case if the charges had been filed while the former president was still in power.
The BBC's Idy Baraou in Niger says the law was framed in this way to stop politically motivated cases from being brought against deposed leaders.
Mr Tandja was arrested last February and put under house arrest until January when he was moved to prison, ahead of the first round of elections.
His immunity from prosecution was lifted in December 2010.
A former army officer, he was first voted into office in 1999 and was returned to power in an election in 2004.
He was widely criticised for changing the constitution in 2009 to allow him to stand for a third term.
But Mr Tandja's supporters argued that his decade in power brought a measure of economic stability to Niger, one of the world's poorest countries.
Last October, voters in Niger backed a new constitution which reduces the powers of future presidents and limits them to two terms in office.
http://www.bbc.co.uk/news/world-africa-13348823