Military officers on Friday said they had dismissed the leader of Burkina Faso's junta, in the country's second coup this year.
They declared the removal of Lieutenant-Colonel Paul-Henri Sandaogo Damiba, who himself came to power in a coup in January, in a statement read out on national television.
The rebelling military also announced the closure of borders from midnight, as well as the suspension of the constitution and the dissolution of the government.
They proclaimed Captain Ibrahim Traore as the country's new strongman.
Around 15 soldiers in fatigues appeared on the Radio-Television broadcaster shortly before 8:00 pm local time.
"We have decided to take our responsibilities, driven by a single ideal -- the restoration of security and integrity of our territory", they said.
A curfew from 9:00 pm to 5:00 am was also announced.
The United States said it was "deeply concerned" by events in Ouagadougou and was encouraging US citizens to limit movements.
"We call for a return to calm and restraint by all actors," a State Department spokesperson said.
Earlier on Friday, the government said an "internal crisis" within the army was behind troop deployments in key areas of the capital, and said negotiations had been underway after shots rang out before dawn.
Gunfire was heard around the presidential palace and headquarters of the military junta, witnesses told AFP.
The transitional government, set up by Damiba and his team, had said there had been an "internal crisis in the army", after AFP journalists saw troops block several main roads in Ouagadougou.
Government spokesman Lionel Bilgo had said the "crisis" was based on army pay claims, and that Damiba was taking part in discussions.
During the morning, shots rang out in the Ouaga 2000 neighbourhood which houses both the presidential and military junta headquarters, an AFP video journalist said.
A resident who lives close to the presidential palace said: "I heard heavy detonations around 4:30 am and now the roads around my home have been sealed off by military vehicles".
State television was cut for several hours on Friday, prior to the military announcement, broadcasting just a blank screen with the message "no video signal".
Troops were seen at the city's main crossroads, especially in Ouaga 2000 but also outside the state television centre.
In the afternoon an AFP journalist saw a group of several hundred people gather in a city square making a range of demands, including for the departure of Damiba and the end of the French military presence.
The French foreign ministry told its citizens in the city, believed to number between 4,000 and 5,000, to stay home.
In Brussels, the EU voiced "concern" at the events unfolding in the Burkina capital.
"A military movement was observed from 04:30 this morning. The situation still remains particularly confused," said spokeswoman Nabila Massrali, before the announcement of the latest coup.
By the evening the soldiers were still in place at key points of the city, and streets were mostly deserted.
Violence has long wracked the landlocked west African country where Damiba took power in a January coup, ousting elected leader Roch Marc Christian Kabore.
Damiba had pledged to restore civilian rule within two years and to defeat the armed factions.
As in bordering countries, insurgents affiliated with Al-Qaeda and the Islamic State group have stoked unrest.
Thousands have died and about two million have been displaced by the fighting since 2015 when the insurgency spread into Burkina Faso, which has since become the epicentre of the violence across the Sahel.
Damiba earlier this month sacked his defence minister and assumed the role himself.
More than 40 per cent of Burkina Faso, a former French colony, is outside government control.
Attacks have increased since mid-March, despite the junta's vow to make security its top priority.
September has been particularly bloody.
On Monday, suspected jihadists attacked a convoy carrying supplies to the town of Djibo in the north of the country. The government said 11 soldiers died and around 50 civilians were missing.
On September 5 an improvised explosive device struck a supply convoy in the north killing 35 civilians and wounding 37.
The following day, at least nine people, seven civilians and two soldiers, were killed in two separate attacks by suspected jihadists.
In June, 86 civilians died in a massacre at Seytenga, near the border with Niger.
Much of the impoverished Sahel region is battling the insurgency.
Starting in northern Mali in 2012, the insurgents attacked neighbouring Burkina Faso and Niger in 2015.
The violence has in recent years begun to spill over into coastal states Ivory Coast, Togo and Benin.