The claimed takeover sparked condemnation from the African Union and alarm from Nigeria over "contagious autocracy" in a continent where the military have seized power in five other countries since 2020.
Bongo, 64, who took over from his father Omar in 2009, was placed under house arrest and one of his sons arrested for treason, the coup leaders said.
TV images showed the head of the Republican Guard, Gen. Brice Oligui Nguema, being carried in triumph by hundreds of soldiers, to cries of "Oligui president."
The coup leaders later named Oligui Nguema "transitional president," according to a TV statement.
In a dramatic pre-dawn address, a group of officers declared "all the institutions of the republic" had been dissolved, the election results canceled, and the borders closed.
"Today, the country is going through a serious institutional, political, economic and social crisis," according to the statement read on state TV.
It was read by an officer flanked by a group of a dozen army colonels, members of the elite Republican Guard, regular soldiers and others.
From detention in his residence, Bongo, whose family has ruled the Central African nation for 55 years, appealed in a video statement to "all the friends that we have all over the world," imploring them to "make noise"on his and his family's behalf, about what he termed, his arrest by the military.
Bongo said he did not know what was happening.
"Right now, I'm in the residence and nothing happening ... nothing is happening," said Bongo from one of the rooms in the presidential resident. "I don't know what is going on," he added.
Unlike Niger, which witnessed its leader Mohamed Bazoum deposed in a July 26 coup, and other Sahel countries, Gabon, which lies further south on the Atlantic coast, has not had to battle destabilizing Islamist insurgencies. But the coup is a further sign of democratic backsliding in the volatile region.
A "contagion of autocracy" is spreading across Africa, Nigerian President Bola Tinubu, the current chair of West African bloc ECOWAS, said Wednesday. He said he was working closely with other African leaders on how to respond in Gabon.
United Nations Secretary-General Antonio Guterres condemned the events and called on the military to ensure the safety of Bongo and his family, while China and Russia said they hoped for a swift return to stability.
The United States said the situation was deeply concerning.
U.S. National Security Council spokesperson John Kirby said Washington was "closely watching" the political developments in Gabon, adding "we will remain a supporter of the people in the region, supporting the people of Gabon and their demand for democratic governance."
Information for this report came from AFP and Reuters.