The country's democratic credentials have been deeply wounded by dodgy official results, protest riots and a brutal government crackdown.
Gabon's model of political moderation and gradualist reform may have just imploded. Without external mediation, a full audit of polling station results and a hitherto absent readiness to compromise on the part of President Ali Bongo Ondimba and his main challenger, Jean Ping, the country risks being condemned to months or even years of unstable and sullen post-election stalemate.
Mild though the crisis appears by the standards of more authoritarian or conflict-torn neighbours, it is disastrously damaging for Bongo's long-held ambition of transforming himself from dynastic heir into freely-elected architect of modernization and reform. After seven years trying to mark his country out from the fiefdoms of central Africa's strongmen, he now risks cantoning himself into the category of presidents whose hold on office depends on power rather than consent.
Official results for the 27 August presidential election gave Bongo 49.8% of the nationwide total, compared with 48.23% for Ping; two candidates pulled out to leave Ping a clear run, while the minor players who stayed in the race got trivial scores.
The final winning margin was just 5,594 votes. After severe defeats for Bongo in western urban centres such as Libreville and Port Gentil and with national average turnout at 59%, Bongo was miraculously saved by results from his Haut Ogooué heartland, which registered 95% support on a reported 99% turnout. In the context of a highly secretive electoral system, such an outcome threatens to fundamentally undermine Gabon's democratic ambitions.
Yet the aftermath has been even more damaging. Furious protesters rioted, setting light to the national assembly, other public buildings and the shops of West African traders - a longstanding target of popular resentment.
The government's response has been uncompromising. During the night of 31 August-1 September, security force units, supposedly searching for rioters, took control of Ping's campaign headquarters. There were several deaths, while a number of casualties were taken to hospital with gunshot wounds; dozens were arrested, and senior opposition figures were still in the building, surrounded by security forces, a day later.
Gabon, so often a broker in other nations' disputes, now finds itself being offered African Union crisis mediation. The justice minister has resigned from both government and ruling party, demanding a full audit of all the election counts, polling station by polling station.
Bongo's failed strategy
The violence is a tragedy for Gabon. Street protest is hardly new but is usually curbed with routine policing and the odd volley of tear gas. Moreover, this bloodshed represents a major failure for Bongo's leadership. He came to power in 2009 after the death of his father, Omar Bongo Ondimba, who had ruled for four decades, in elections that were opaque and widely seen as a continuation of the status quo. His subsequent banning of the new Union Nationale opposition party seemed to confirm this pattern.
But Ali has spent much of the past seven years trying to reshape Gabon's governance. He has sought to rebalance and diversify the economy, improve the performance of the state and foster a more equitable social model, tilting social services and public sector wage structures towards the poorer citizens who had previously been neglected in favour of the governing middle class. Key barons of his father's regime were marginalized, the ban on the Union Nationale was lifted, and Bongo acceded to opposition demands for a biometric electoral roll. Assets in France held personally by the Bongo family were transferred to the ownership of the state.
Bongo had hoped that his measures to stimulate the economy and protect the environment, bolster the efficiency of public services and help the poor would allow him to shed his image as the inheritor of dynastic power, and earn his own legitimacy through his own performance as president. In the face of an opposition dominated by the ancien regime power-brokers who he had forced out, Ali sought to present himself as the real incarnation of change.
But several factors combined to undermine this strategy. The influence of several prominent West Africans in the presidency and in business circles close to the government was unpopular with many locals. Like other oil producing countries, Gabon has been hit hard by the collapse in world energy prices, despite its care in nurturing a reputation as a prudent borrower in international bond markets. And ultimately, Bongo under-estimated the scale of anger and impatience for change in a country whose voters are well aware of democracy's advance elsewhere in francophone Africa - powerfully symbolized by the popular revolution that felled Burkina Faso strongman Blaise Compaoré in 2014.
Many Gabonese feel it is now time to move on from the era of dynastic rule, even in the refreshed and more modern form that Ali Bongo Ondimba has provided.
Bongo seems to have been completely unprepared for the strength of the response to the electoral pitch made by Jean Ping. As a former regime veteran once married to Ali's sister Pascaline, Ping could not claim to be a new face. Indeed, having also served a term as chair of the African Union Commission, he is very much part of the establishment.
But he cleverly tapped into the current mood, presenting himself as the man whose election would show that power in Gabon really could change hands through the ballot box. A promise to serve only one term enhanced this appeal - and usefully contrasted with Ali's aspiration to yet another extension of rule by the Bongo dynasty.
When most other opposition candidates dropped out at the last minute, Ping was ideally placed to capitalize.
Furthermore, in the aftermath, Bongo has badly misread the evolution of attitudes in the international community: France, the EU and the US want to see a transparent and credible election process. Even Paris, for so many years a supportive ally of the Bongos, is no longer prepared to turn a blind eye. As a result, pressure is mounting for a full breakdown of the vote, to show figures for every single polling station. Privately, many diplomats feel it is clear that Ping won, even if there was cheating on all sides.
Looking ahead, there seems no easy way out. The most consensual option would be a full audit of the election count, with both contenders fully committed to accepting the eventual result - a course of action that would offer a face saving and honourable way out to the loser. Without that, Gabon seems condemned to a prolonged period of unrest and political confrontation. Even if Bongo hangs on, his standing will be critically damaged.
Paul Melly Associate Fellow, Africa Programme