In a statement read on state television by spokesman Diniz N'Tchama, the army officers said they had deposed President Umaro Sissoco Embalo, suspended the electoral process, shut borders and would enforce a curfew.
Shortly after, Embalo told France 24 TV: "I have been deposed."
They army officers said in their statement they had formed "The High Military Command for the Restoration of Order" and would be in charge of the west African country until further notice.
N'Tchama said the move was in reaction to "the discovery of an ongoing plan" aiming to destabilise the country, adding that "domestic and foreign citizens" attempted to "manipulate electoral results to implement this plan".
The officers did not specify if they had taken Embalo into custody but two security sources told Reuters that he was being held at the office of the army chief of staff.
The sources said his top challenger in the election, Fernando Dias, and the man he defeated in the last election in 2019, former prime minister Domingos Simoes Pereira, were also in custody.
Shortly before the announcement, gunfire rang out near the electoral commission headquarters, presidential palace and interior ministry, witnesses said.
It lasted for about an hour, a Reuters journalist said.
There was no word yet of any casualties.
It was the latest outbreak of unrest in Guinea-Bissau, a small coastal country situated between Senegal and Guinea that is a notorious hub for cocaine bound for Europe.
It was not immediately clear whether the army had the support of all of Guinea-Bissau's fractious armed forces or whether they were in control of all of the country of about two million people.
The electoral commission had been due on Thursday to announce provisional results from Sunday's election in which Embalo faced off against top challenger Fernando Dias.
Both sides had claimed victory in the first round of voting.
Embalo was seeking to become the first president in three decades to win a second consecutive term in Guinea-Bissau, a small coastal country between Senegal and Guinea.
A spokesperson for Embalo, Antonio Yaya Seidy, told Reuters that unidentified gunmen attacked the election commission to prevent an announcement of the vote results.
He said the men were affiliated with Dias, without providing evidence.
A spokesperson for Dias did not immediately respond to a request for comment.
Pereira, who lost to Embalo in a contested runoff in 2019 and has backed Dias in this election, told Reuters that Dias had nothing to do with the incident.
Dias was meeting election observers when "some people erupted in the room to announce that there were gunshots in the centre of the town," said Pereira, who said he was in the same meeting and spoke to Reuters before security sources said he had been detained.
Guinea-Bissau had been shaken by at least nine coups and attempted coups between 1974, when it gained independence from Portugal, and 2020, when Embalo took office.
Embalo has said he has survived three coup attempts during his time in office.
His critics have accused him of manufacturing crises as an excuse for crackdowns.
Gunfire rang out for hours in the capital in December 2023 in what Embalo's government said was an attempted putsch.
Embalo dissolved parliament in response, and the country has been without a functioning legislature ever since.
with AP