A group of military officers say they have seized control of Guinea-Bissau amid reports that the president, Umaro Sissoco Embaló, has been arrested.
Shortly after gunshots were heard in the capital, Bissau, government sources told the BBC that Embaló had been detained.
The officers then appeared on state TV, saying they had suspended the electoral process, as the West African nation awaited the outcome of Sunday's presidential election.
They said they were acting to thwart a plot by unnamed politicians who had "the support of a well-known drug baron" to destabilise the country, and announced the closure of its borders and imposed a night-time curfew.
Sandwiched between Senegal and Guinea, the coup-prone country is known as a notorious drug-trafficking hub where the military has been influential since independence from Portugal in 1974.
The election results were expected on Thursday - both Embaló and his closest rival Fernando Dias had claimed victory.
Dias was supported by former Prime Minister Domingos Pereira, who had been disqualified from running.
Late on Wednesday afternoon, Embaló told France 24 in a phone call: "I have been deposed."
Government sources have since told the BBC that Dias, Pereira and Interior Minister Botché Candé have also been detained.
The putschists have taken army chief Gen Biague Na Ntan and his deputy, Gen Mamadou Touré, into custody too, the sources say.
In a joint statement, leaders of election observation missions from the African Union and the West African bloc Ecowas expressed "deep concern with the announcement of a coup d'etat by the armed forces".
They said the country had been prepared for the announcement of the election results after what it described as an "orderly and peaceful" process.
"It's regrettable that this announcement came at a time when the missions had just concluded meeting with the two leading presidential candidates, who assured us of their willingness to accept the will of the people," they said.
Gunshots heard near presidential palace in the capital Bissau
Witnesses in Bissau heard gunfire earlier on, at around 13:00 GMT, but it was not immediately clear who was involved in the shooting or if there were any casualties.
Hundreds of people on foot and in vehicles fled, seeking shelter as the shots rang out, the AFP news agency reported.
Later on, General Denis N'Canha, head of the military household at the presidential palace, read out a statement declaring a takeover.
He said officers had formed "the High Military Command for the Restoration of Order" and instructed the population to "remain calm".
Checkpoints have been erected across Bissau and the streets were deserted ahead of the curfew, that was due to start at 19:00 GMT.
Portugal has called for a return to constitutional order, with its foreign ministry urging "all those involved to refrain from any act of institutional or civic violence".
The former Portuguese colony has witnessed at least nine coups or attempted coups over the last five decades.

President Embaló was elected in December 2019
Embaló has said he has survived multiple coup attempts during his time in office. However, his critics allege he has fabricated crises in order to crack down on dissent.
The 53-year-old had wanted to make history as the country's only president to secure a second consecutive mandate in the last 30 years.
He had initially said he would not seek a second term. Prior to the delayed polls, his legitimacy had been questioned, with the opposition saying his term should have officially ended in February 2025.
Guinea-Bissau is one of the poorest countries in the world with a population of more than two million people.
Its coastline has many uninhabited islands, making it ideal for drug traffickers - with the UN dubbing it a "narco-state" as it has been a key transit point for cocaine coming from Latin America to Europe.
