The military authorities that seized power in Gabon on Wednesday appointed General Price Oligui Nguuma as interim head of state in West Africa.
Gen Nguema was earlier paraded through the streets of the capital Libreville by his troops.
The ousted president, Ali Bongo, appeared in a video at his home and called on his “friends around the world” to “raise their voices” on his behalf.
The former French colony is one of Africa’s major oil producers.
Mr Bongo’s ouster ended his family’s 55-year rule.
Army officials appeared on television early Wednesday to say they had seized power.
They have annulled the results of Saturday’s election, in which Mr Bongo was declared the winner, but the opposition said it was rigged.
Officials also said they have arrested one of Bongo’s sons for sedition.
Within hours, the generals met to discuss who would lead the transition and unanimously voted to appoint Jen Nukuma, the former head of the presidential security force.
People in Libreville and elsewhere celebrated the army’s announcement.
But the UN, the African Union and France, which had close ties to the Bongo family, condemned the coup.
The U.S. State Department urged Gabon’s military to “protect civilian rule” and to “release members of the government responsible for ensuring security.” England condemned the “unconstitutional military seizure of power”.
Gabon has been ruled for 55 years – long resented by the Bongo family – and there is public discontent over broader issues such as the cost of living.
“At first I was scared, but then I felt happy,” the Libreville resident, who asked not to be named, told the BBC. “I was scared because I realized I was living through a conspiracy, but the joy is that we have waited so long for this regime to be overthrown.”
The Gabon Conspiracy: The Basics
Where is Gabon? It is an oil and mineral-rich country on the west coast of central Africa, with just 2.4 million people.
Who is Ali Bongo? He has been president since 2009 after being declared victorious in Saturday’s disputed elections. Before that, his father ruled for 41 years.
Why was there a conspiracy? The military does not accept the election results, saying it seized power to maintain peace.
General Nkuma, 48, was not among the first three statements read on national television by senior military officers to announce the coup.
But he was soon named interim leader, and carried through the streets in jubilant scenes.
He was an aide to the ousted leader’s father, Omar Bongo, who ruled for nearly 42 years until his death in 2009.
A former close colleague told the AFP news agency that Jen Nukuma was very close to Omar Bongo and served him from 2005 until his death in a Spanish hospital.
Under Ali Bongo he first served as military attaché at Gabon’s embassies in Morocco and Senegal.
But in 2018, before he was promoted to general, Ali Bongo was replaced by Frédéric Bongo, half-brother, as intelligence chief under the elite Republican Guard – Gabon’s most powerful military unit.
As with previous general elections in Gabon, there were serious concerns about the process in Saturday’s vote.
Main opposition candidate Albert Ondo Ossa complained that many polling stations did not have ballot papers with his name on them, while the coalition he represents said the names of some who dropped out of the presidential race were still on the ballot paper.
Both of Mr Bongo’s previous wins have been disputed by opponents as rigged. This time, controversial changes were made to the ballot papers weeks before the election day.
In 2018, he suffered a stroke that sidelined him for almost a year and led to calls for him to step aside.
The following year, soldiers who mutinied in a failed coup attempt were sent to prison.