A court in Niger has ordered the release on bail of opposition leader Hama Amadou, who went to France earlier this month for medical treatment.
Mr Amadou was imprisoned in November to face baby-trafficking charges, which he denies - arguing they are politically motivated.
He had campaigned for elections in February from behind bars.
His party boycotted the run-off vote on 20 March, won by President Mahamadou Issoufou with 92% of the vote.
"The decision [of the court of appeal] is clear, he is free as of today," Mr Amadou's lawyer, Mossi Boubacar, told reporters in the capital, Niamey.
Mr Amadou, who was airlifted to a US hospital in Paris four days before the run-off, is determined to return home, Mr Boubacar added.
"He should be out today or tomorrow," Mr Amadou's doctor, Luc Karsenty, told the AFP news agency in Paris.
The ruling means Mr Amadou will not have to return to his prison if he goes back to the country, reports the BBC's Baro Arzika from Niamey.
It is not yet clear whether the baby-trafficking case will continue, he says.
More than 20 people were accused of involvement, including Mr Amadou's wife, but they have all now been released on bail.
The court ruling comes a day after the opposition coalition met the prime minister with a view to finding a solution to the stand-off that has followed the second-round vote.
The coalition backing Mr Amadou said the presidential run-off was a farce.
The government has not yet reacted to the court's ruling.
President Issoufou will be sworn in for his second five-year term in office on Saturday.
- 19 February 2018
- 19 February 2016
- 17 February 2016