"We condemn the coup attempt that took place this morning in Gabon", said the Foreign Ministry in a statement.
"I reaffirm the AU's total rejection of all unconstitutional changes of power", he said.
Government spokesman Guy-Bertrand Mapangou told Radio France International that the five officers involved were arrested in the capital Libreville on Monday.
The Gabonese soldiers staging the coup announced the establishment of a "restoration council" via the national radio station after it was taken over by soldiers.
However, according to the government spokesperson, the coup plotters have been arrested and the country will be back to order in a few hours.
In a letter to congressional leaders the USA president said the personnel were there to protect U.S. citizens and the embassy, but also "in furtherance of United States national security and foreign policy interests", adding that they would be there until the DRC's security situation looked stable enough that they were not needed - and that more could be deployed if necessary.
Ali Bongo, 59, suffered a stroke on October 24 while in Saudi Arabia and has not been in Gabon since then, recovering in Morocco.
In the message he gave to the nation on December 31, he expressed gladness that the condition of his health was improving.
A curfew has been imposed over the capital, Libreville, and the internet was cut.
Reports from news agencies said the coup attempt was accompanied by scattered gunfire in the capital, Libreville, and videos posted on social media showed armoured vehicles speeding through the streets, while helicopters circled overhead.
About 300 people gathered at the radio station in support of the coup but the military dispersed them using tear gas.
The French-educated Bongo, who was the country's defense minister before becoming president, narrowly won re-election in 2016 in a vote opposition rival Jean Ping claimed was plagued by irregularities, and he continues to call himself the country's real president.
U.S. President Donald Trump recently deployed American military personnel to Gabon because of fears on political unrest in neighbouring Congo.
Despite Gabon's vast oil wealth, most of its two million people are living in poverty.