(AFP) - In a court document seen by French news agency AFP, Salem Bazoum was given "provisional release" after having been held with his parents since the presidential guard took power on 26 July 2023.
The document added that it was "up to him to respond to justice as soon as he is required to do so".
The 22-year-old's parents remain in custody at the presidential residence.
A source close to the ousted president told AFP that Salem Bazoum had left Niamey for Lome, the capital of Togo, where he arrived Monday evening.
A statement by the Togolese government confirmed a deal for Bazoum's release after mediation from Togo and Sierra Leone but gave no details about his whereabouts.
Three-year transition
Niger has been ruled by military leaders since the overthrow of elected president Bazoum, which prompted international condemnation.
Military ruler General Abdourahamane Tiani has said his regime wants up to three years for a transition back to a civilian government.
Togo is among several West African states which have been involved in mediation with the Nigerien military regime.
On Monday, Togo Foreign Minister Robert Dussey was in Niamey, where he met with Niger's junta-appointed prime minister, according to Nigerian public television.
This followed a trip by Dussey in mid-December when he said he had reached an agreement "on the content and timing of the transition" with the prime minister.
The new military regime has distanced itself from Niger's hitherto close European partners – notably France – and has drawn closer to two of its neighbours, Mali and Burkina Faso, which after recent coups are also run by militaries.
The last French troops withdrew from Niger in December.
Like neighbouring Burkina Faso and Mali, Niger has faced persistent jihadist violence, particularly in the so-called Tri-border area where the three Sahel countries meet.
Tough sanctions
After the ouster of Bazoum, the Economic Community of West African States (Ecowas) also imposed tough economic and financial sanctions on Niamey.
Food prices have risen and there is a shortage of some basic items such as medicine, in what is one of the world's poorest countries. Togo is one of several countries which have recently softened their position towards the Nigerien authorities.
Benin President Patrice Talon last month called for relations to be swiftly re-established between his country and neighbouring Niger.
A week later Benin lifted its suspension of imported goods transiting to Niger through the port of Cotonou after five months of sanctions.
Niger is currently still suspended from Ecowas – which has said that the release of Bazoum and his return to power are among the conditions for the easing of sanctions.
Several former officials of the overthrown government have been arrested, and others are in exile.
Former energy minister Ibrahim Yacoubou was arrested last week upon his return to the country.