The military government in Niger says it has foiled an attempt by the deposed former President, Mohamed Bazoum, to escape from custody.
The former president attempted to flee in the night with his family, cooks and security, a military spokesman said.
There were plans for the group to fly out on helicopters but the plan was foiled, he added.
Mr Bazoum’s lawyers have called for his immediate release, saying his detention is illegal.
He has been under house arrest along with his wife and son since members of his presidential guard staged a coup in late July.
The lawyers say the ousted president and his family can only be visited by a doctor who brings them food every other day, and on Friday morning even this was not allowed. They demanded proof that he was still alive.
Niger is part of the African region known as the Sahel – a belt of semi-arid land that stretches from the Atlantic Ocean to the Red Sea, just south of the Sahara Desert. The area is plagued by jihadists and beset by military regimes.
The attempted escape happened around 03:00 (02:00 GMT) on Thursday, military spokesman Amadou Abdramane said on state television.
“The ousted President Mohamed Bazoum and his family, his two cooks and two security elements, tried to escape from his place of detention,” he said.
The escape bid failed and “the main actors and some of the accomplices” were arrested, he added.
The elaborate plan involved Mr Bazoum getting to a hideout on the outskirts of the capital Niamey, Mr Abdramane said.
The group had then planned to fly out on helicopters “belonging to a foreign power” towards Nigeria, he added, denouncing Mr Bazoum’s “irresponsible attitude”.
It is not clear where the former president and the rest of the group are now being held. An investigation into the alleged escape attempt has been launched.
The Niger military overthrew the democratically elected president in a coup on 26 July.
It mirrored similar military takeovers in neighbouring Burkina Faso and Mali, amid an Islamist insurgency and a growing Russian influence in the wider Sahel region through its mercenary group Wagner.
As in Mali, Niger’s junta has ordered French troops based in the country to help fight the jihadists to leave the country. The first convoy from Niger arrived in neighbouring Chad on Thursday after a nine-day trip, the French military said.
Mr Bazoum has refused to officially resign.
Despite his captivity, he was able to publish an article in The Washington Post stating that he was a hostage and that the coup would have “devastating consequences for our country, our region and the entire world”.
Soon after Mr Bazoum was overthrown, US President Joe Biden called for his immediate release and the “preservation of Niger’s hard-earned democracy”.
That followed the expiration of a deadline by Ecowas, a power block of West African states, for the coup leaders to stand down.
Its threats of military intervention were not followed through, and the junta continues to ignore demands for the president’s freedom.
Mr Bazoum’s party and family members say he has had no access to running water, electricity or fresh goods.