Government spokesman Guy-Bertrand Mapangou told Reuters that four of the five officers who had taken over the state radio in the capital Libreville were arrested.
A fifth officer fled and is being pursued, he said.
A military source, speaking on condition of anonymity, said the masterminds of the attempted coup had not yet been arrested, however.
Outside the radio station, loyalist soldiers fired teargas to disperse about 300 people who had come out into the streets to support the coup attempt, a Reuters witness said. Helicopters circled overhead, although most of Libreville was quiet.
In a radio message at 4:30 a.m. (0330 GMT), Lieutenant Kelly Ondo Obiang, who described himself as an officer in the Republican Guard, said Bongo’s New Year’s eve address from Morocco, where he is recovering from a stroke, “reinforced doubts about the president’s ability to continue to carry out of the responsibilities of his office”.
Bongo’s speech was slurred and he appeared unable to move his right arm. It is unclear if he is able to walk.
Bongo, 59, was hospitalised in October in Saudi Arabia after suffering a stroke. He has been in Morocco since November to continue treatment.
The Bongo family has ruled the oil-producing country for nearly half a century. Bongo has been president since succeeding his father, Omar, who died in 2009. His re-election in 2016 was marred by claims of fraud and violent protest.
A sharp drop in oil production and prices has squeezed revenues and stoked discontent in recent years.
In a video circulating on social media, Ondo is seen in a radio studio wearing military fatigues and a green beret as he reads the statement. Two other soldiers with large assault rifles stand behind him.
Ondo said the coup was being carried out by a group called the Patriotic Movement of the Defence and Security Forces of Gabon against “those who, in a cowardly way, assassinated our young compatriots on the night of August 31, 2016,” a reference to deadly violence that erupted after Bongo was declared the winner of the disputed election.
The military officer said the coup attempt was carried out by one unit under the command of a high-ranking officer but that other units were monitoring the situation.
“President Bongo’s record as defence minister under his father lowers the possibility that current military leadership is supportive of his ouster,” said Judd Devermont, director of the Africa Program at the Centre for Strategic and International Studies in Washington.
Former colonial power France has a permanent military force of 300 soldiers in Gabon. The United States also sent about 80 soldiers to Gabon last week in response to possible violent demonstrations in Democratic Republic of Congo after a presidential election there.
Bongo and members of his government have faced repeated suspicions by foreign governments of corruption, including allegedly using the American financial system to launder assets. They have denied the accusations.
During his father’s rule, Gabon was a pillar of “La Francafrique”, an intricate, shadowy web of diplomacy, commerce and French military might that kept African autocrats in power and gave French companies privileged access to them.
Bongo won the election in 2016 by fewer than 6,000 votes, sparking deadly clashes between protesters and police during which the parliament was torched.
The European Union said it found anomalies during the election in Bongo’s stronghold province of Haut-Ogooue, where he won 95 percent on a 99.9 percent turnout.