The fate of Guinea's President Alpha Condé is unclear after an unverified video showed him surrounded by soldiers, who said they had seized power.
They appeared on national TV claiming to have dissolved the government.
However, the defence ministry said the attempted takeover had been thwarted by the presidential guard.
This follows hours of heavy gunfire near the presidential palace in the capital, Conakry.
UN secretary-general Antonio Guterres and the African Union have condemned the apparent coup and demanded the immediate release of President Condé.
The West African country of Guinea is rich in natural resources but years of unrest and mismanagement mean it is one of the world's poorest countries.
President barefoot on a sofa
The TV address featured nine unnamed soldiers, several draped in the red, gold and green national flag, who said they had taken over because of rampant corruption, mismanagement and poverty.
Calling themselves the National Committee for Reconciliation and Development, they said the constitution had been dissolved and that there would be consultations to create a new, more inclusive one.
Numerous reports say the coup was led by an elite unit headed by a former French legionnaire, Lt Col Mamady Doumbouya.
In one video, which the BBC has not been able to verify, soldiers ask President Condé, 83, to confirm he is unharmed but he refuses to respond.
Sitting barefoot on a sofa wearing jeans and a printed shirt, he does not have any visible injuries. His current whereabouts are unknown.
Those behind the coup said that all land and air borders had been closed for a week.
However, according to the defence ministry, forces loyal to the president have "contained the threat and repelled the group of assailants".
Earlier, the only bridge connecting the mainland to the Kaloum peninsular, which houses most ministries and the presidential palace, was sealed off while many soldiers, some heavily armed, were posted around the palace, a military source told Reuters news agency.
There are unconfirmed reports that three soldiers have been killed.
Following the news, opposition supporters and activists took to the streets in celebration.
"We are here to show our joy because we suffered a lot over time," Abdoulaye Oumou Sow said. "We have been very patient."
In their televised announcement, the so-called National Committee for Reconciliation and Development made all the right noises.
For those frustrated by last year's constitutional change that allowed President Alpha Condé to run for a third term, news that the constitution would now be scrapped and replaced in consultation with the public has been warmly welcomed.
Already there are reports of crowds of opposition supporters and activists taking to the streets of Conakry, to celebrate.
But military juntas are notoriously fickle. With no one to hold them to account, there's no guarantee they'll deliver on their promises.
There are also those who worry that this latest coup is further evidence of a gradual degradation of democratic values in the region.
It's the fourth attempted coup in West Africa in just over a year. There have been two military takeovers in Mali and a failed attempt in Niger since August 2020.
Contested constitutional amendments in Guinea and the Ivory Coast, a region that had been celebrated for a number of peaceful transitions of power in the nineties and early 2000s, appears to be regressing.
Ultimately those who'll pay the price for the erosion of democratic institutions are ordinary West Africans, left without the protections these institutions were meant to provide.
As a result of the unrest, Guinea's football World Cup qualifying match against Morocco at home on 6 September has been postponed. Football body FIFA said the decision was made to "ensure the safety and security of all players and to protect all match officials".
The Moroccan team is trapped in Guinea following the coup and is said to be awaiting clearance from their embassy to travel to the airport.
President Condé was re-elected for a controversial third term in office amid violent protests last year.
The veteran opposition leader was first elected in 2010 in the country's first democratic transfer of power. Despite overseeing some economic progress, he has since been accused of presiding over numerous human rights abuses and harassment of his critics.