Niger's coup leader has promised to return the West African nation to civilian rule within three years.
Gen Abdourahamane Tchiani made the announcement after meeting mediators from the West African regional bloc Ecowas in the capital, Niamey.
Ecowas has threatened military action to reverse last month's overthrow of President Mohamed Bazoum if talks fail.
The junta head said that Niger did not want a war but would defend itself against any foreign intervention.
"If an attack were to be undertaken against us, it will not be the walk in the park some people seem to think," he warned in his televised address on Saturday evening.
Gen Tchiani also reiterated criticism of what he called the "illegal and inhumane" sanctions imposed by Ecowas on the landlocked country.
This has included cutting electricity, resulting in blackouts in Niamey and other major cities, as well as blocking crucial imports.
Lorry drivers have been stuck for weeks waiting to bring in supplies, forcing up food prices.
"Sanctions are not conceived with the aim of finding a solution but to bring us to our knees and humiliate us," Gen Tchiani said.
Thousands of men came to a stadium in Niamey on Saturday to register for a volunteer force in case of invasion - although overcrowding prevented the registration process from starting, the Reuters news agency reports.
Regional efforts to reverse the coup have been backed by the US and France, which both have military bases in Niger. These bases are part of efforts to tackle jihadist groups in the wider Sahel region.
The junta leader, who headed the presidential guard before seizing power on 26 July, said military intervention could worsen the Islamist insurgencies linked to al-Qaeda and the Islamic State group.
"They seem ignorant to the fact that it is in large part thanks to the professionalism and valour of the defence and security forces of Niger that Niger has remained a barrier preventing terrorist hordes from destabilising the whole region," he said.
The coup mirrors similar recent takeovers in neighbouring Burkina Faso and Mali.
And the influence of Russia in the wider Sahel region is also growing through its mercenary group Wagner.
Gen Tchiani did not give details about the handover of power, but said the principles for the transition would be decided within 30 days at a "dialogue" hosted by the coup leaders.
Ecowas has not yet commented on the announcement except to say that during the visit on Saturday, mediators also met Mr Bazoum, who has been in detention with his wife and son since the coup.
Their delegation was led by former Nigerian military leader Gen Abdulsalami Abubakar and also included Nigeria's most senior Muslim leader, the Sultan of Sokoto, Muhammadu Sa'adu Abubakar III.
He wields huge influence in Niger, part of which used to be in the Sokoto Caliphate, a powerful kingdom before colonial rule.
Saturday's meeting was was the first between leaders of the junta and Ecowas.
Latest Stories
-
Hindsight: Dear GFA, where is the DNA?
35 mins -
Mass wedding for Nigeria orphans sparks outcry
54 mins -
US troops to leave Niger by mid-September
1 hour -
DR Congo army says it has thwarted attempted coup
2 hours -
GPL 2023/24: Aduana beat Hearts to go third; Samartex close in on title
3 hours -
Tipper truck crushes one to death at Kasoa
3 hours -
Baba Rahman wins Greece Super League title with PAOK
3 hours -
Demolition orders should be part of court’s inherent power – Lawyer
4 hours -
British company duped off £20m with an AI-generated video of its CFO
4 hours -
Kissi Agyebeng deserves applause for blowing whistle on money laundering – Kpebu
4 hours -
Diddy apologises after video shows attack on ex-girlfriend
4 hours -
Israel-Hamas war: Ghana calls for unconditional release of hostages
4 hours -
Presidency mourns deceased driver in Akufo-Addo convoy accident
5 hours -
Playback: The Probe discussed EOCO’s mishandling of Cecelia Dapaah case
6 hours -
There’s no need to seek additional demolition permit from Supreme Court – Lawyer
6 hours