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 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.