Niger's ousted president Mohamed Bazoum, who has been held in detention since a July 26 coup, must be freed immediately, the court of the West African bloc, ECOWAS, ordered on Friday.
The court called for his "immediate and unconditional release" and ordered that Bazoum be reinstated, according to the judge in the case heard in Nigeria's capital Abuja.
Niger is currently suspended from the Economic Community of West African States after the presidential guard overthrew Bazoum and put him and his family in detention.
"It is Mohamed Bazoum who represents the state of Niger... he remains president of the republic," the court ruling said.
"There are constitutional rights that have been violated."
Bazoum has been held in his presidential residence with his wife and their son since he was overthrown.
Niger's military rulers did not immediately respond to the ruling. Other member states have, in the past, ignored rulings from the ECOWAS court.
In mid-September, the deposed president appealed to the ECOWAS Court of Justice to obtain his release and the restoration of constitutional order in the country.
"The decisions of the court are not subject to any appeal," Bazoum's collective of lawyers said in a statement sent to AFP.
According to Seydou Diagne, one of Bazoum's lawyers, the court "for the first time convicted military authorities who with their coup d'état violated the principles of the constitution of ECOWAS".
"It is the responsibility of ECOWAS and its member states to ensure that this court decision is effectively applied," the lawyers' statement said.
ECOWAS on Thursday announced that Niger was now suspended from all of its "decision-making bodies" until constitutional order is restored.
'Timing' for transition
ECOWAS, which has imposed heavy economic and financial sanctions against Niger and cut off trade after the coup, has resumed dialogue with the military regime.
On Thursday, Togolese Foreign Minister Robert Dussey, who was on mediation mission in Niamey, said details on the transition back to civilian rule in Niger had been agreed with its prime minister Ali Mahaman Lamine Zeine, a civilian appointed by the military regime.
Read moreNiger businesses struggle to make ends meet in wake of coup
Dussey told Niger national television Tele Sahel that he had "worked and agreed on the content and timing of the transition" with the premier and the regime's Foreign Minister Bakary Yaou Sangare.
"We will present this content... agreed together to the mediating heads of state and the ECOWAS Commission," he said, without giving any details on how long the transition would be or how it would happen.
According to Tele Sahel, Dussey will return to Niamey in January with his counterpart from Sierra Leone, Timothy Kabba.
On Sunday, an ECOWAS summit in Abuja opened the way to a reduction of its sanctions against Niger but on the condition that there is a "short transition" back to civilian rule.
ECOWAS leaders decided that a heads-of-state committee made up of Benin, Togo and Sierra Leone would negotiate with the Nigerien military regime on steps needed before a possible relaxation of sanctions.
In August, the head of the military regime, General Abdourahamane Tiani, declared that the duration of the transition would not exceed three years and would be determined by "an inclusive national dialogue".
(AFP)