Niger's President Mohamed Bazoum has issued a defiant message on Twitter after soldiers announced a coup overnight in the West African nation.
Trouble began early on Wednesday when troops from the presidential guard took him captive.
His foreign minister has said the takeover does not have the backing of the whole military, but the army chief has now said he backs the junta.
Mr Bazoum is a key Western ally in the fight against Islamist militants.
The US and France, the former colonial power, both have military bases in the uranium-rich country - and have condemned the coup.
US Secretary of State Antony Blinken called up Mr Bazoum promising Washington's "unwavering support" and the UN, the European Union and Russia have all called for the president's immediate release.
The 64-year-old, who was elected Niger's president two years ago, took to Twitter on Thursday morning to say: "The hard-won achievements will be safeguarded. All Nigeriens who love democracy and freedom will see to it."
State TV has been repeating the late-night coup announcement interspersed with patriot music and Quranic verses - and its usual 12:30 GMT news bulletin was not aired.
But in the capital, Niamey, shops and markets opened for business and after delays due to heavy rain in the morning, coup supporters took to the streets.
Some who gathered outside the National Assembly had Russian flags, while others held up hand-written signs saying: "Down with France" and "Foreign bases out".
Others gathered outside the headquarters of the president's PNDS Tarraya party, with footage showing them throwing stones and setting fire to vehicles.
They accuse the party of corruption and not doing enough to improve the security situation and end the long-running jihadist insurgency.
Two neighbouring countries, Mali and Burkina Faso, have experienced coups triggered by Islamist uprisings in recent years.
In both countries the new military leaders have moved closer to Russia after falling out with France, which also previously ruled Niger.
"I hope they will install good security in the city and help us to achieve better conditions, because we have good resources. I don't care if they just want to follow Burkina Faso or Mali," Djibo, a supporter of the coup, told the BBC.
A number of well-known pro-Kremlin commentators on Telegram - one of the few major social media platforms not banned in Russia - have been posting comments in support of the coup, saying it is an opportunity for Russia and Wagner to get into Niger.
For the moment, there is no evidence of any Russian involvement in this takeover. Moscow has urged all sides to resolve the dispute peacefully.
The junta has reprimanded France for violating the closure of the country's borders after a military plane landed at an air-force base on Thursday morning.
It is not clear at the moment who is really in charge of Niger.
The takeover was announced by a spokesman, Col Maj Amadou Abdramane, who said the takeover was instigated by the deteriorating security situation "and poor economic and social governance".
All the different branches of the security forces were represented during the late-night announcement on national television - an indication that the military is united behind the coup.
Niger's private L'Enqueteur newspaper has suggested the coup was prompted by President Bazoum's attempt to remove Gen Abdourahamane Tchiani as commander of the presidential guard.
The turn of events has split people in Niger - and some are shocked and upset.
While it was under way on Wednesday, hundreds of the president's supporters defied the soldiers to to protest and call for the military to return to the barracks.
They dispersed after warning shots were fired - the only gunfire heard in this bloodless seizure of power.
They have said they will not accept the coup but it is not clear how they will oppose it. They have not called any more streets protests for the time-being.
"The coup is very regrettable. It makes me sad because I want the best for our country. Niger will regress now," Mustapha, a resident of Niamey sheltering at home with his wife and three-year-old son, told the BBC.
Niger's Foreign Minister Hassoumi Massoudou has called on the population to oppose the takeover.
In an interview with the channel France24, he said that the situation could still be resolved through dialogue and said envoys sent from neighbouring Nigeria were talking to the military.
Benin's President Patrice Talon is also on a mediation mission on behalf of the West African regional bloc, Ecowas.
The vast arid country on the edge of the Sahara desert - one of the world's poorest nations - has experienced four coups since independence from France in 1960, as well as numerous attempted coups.













