BANJUL, Gambia — A reviled autocrat refused to leave office even as his democratically elected successor was sworn in as president. Foreign troops rolled across the border, threatening to install the new leader by force. And a hastily declared state of emergency prompted thousands of terrified civilians to flee the country.

The tiny West African nation of Gambia looked poised to tear itself apart last week as longtime leader Yahya Jammeh, who conceded defeat and then later rejected the results of the Dec. 1 election, made a last-ditch effort to cling to power. But by Saturday evening, Jammeh was being whisked into exile aboard a private jet as cautious celebrations broke out in parts of the capital, Banjul.

Eleventh-hour diplomacy, supported by the deployment of 7,000 troops by the Economic Community of West African States (ECOWAS), had pulled this country of 1.9 million back from the brink, underscoring the power of a united regional coalition and hinting at a model for dealing with other recalcitrant dictators on the continent.

“He knew he was going down, internally and externally,” Halifa Sallah, a spokesman for Gambia’s incoming administration, said of Jammeh. “The use of force was very clear. ECOWAS was around the border. The fact that he would be alone, he would have fallen like a house of cards.”

Jammeh, who seized power in a coup in 1994 and has won a series of flawed elections since, shocked the world by conceding defeat to a little-known property developer named Adama Barrow. In a televised address, he called the vote “transparent” and “rig-proof,” pledging to work with Barrow to ensure a smooth transition. But two weeks later, he rejected the outcome, citing unspecified “foreign interference.” He vowed to remain in office until a second election could be held.

The reversal was met with nearly universal condemnation. The United Nations, African Union, and ECOWAS all made it clear that they would no longer recognize Jammeh after his mandate expired on Jan. 19. A series of high-profile delegations, including the presidents of Liberia, Guinea, and Mauritania, visited Banjul to attempt to mediate an end to the crisis. At the same time, ECOWAS indicated that it would remove Jammeh by force if necessary. It mobilized a standby force of 7,000 troops from Senegal, Nigeria, Ghana, and Niger, among other nations, and moved air and naval assets into neighboring Senegal.

Story continues

But negotiations to ease Jammeh out of office dragged on for weeks. In the interim, the embattled Gambian president petitioned the Supreme Court — which hadn’t heard a case in 18 months, because he’d sacked nearly all of the judges — to enjoin Barrow’s inauguration. Then he declared a 90-day state of emergency that conveniently required him to remain in power. Fearing unrest, at least 45,000 people promptly fled to Senegal and Guinea, according to the U.N. refugee agency.

But Jammeh’s regime was slowly crumbling around him. The chief justice of the Supreme Court, who is based in Nigeria, refused to hear the challenge to Barrow’s inauguration until May, when the court was next due to sit. And every day, it seemed, more members of the president’s cabinet deserted him, including the army chief, who eventually conceded that his soldiers would not fight invading ECOWAS troops.

On Jan. 19, Barrow took the oath of office from the safety of the Gambian Embassy in Senegal; ECOWAS and the AU immediately recognized him as Gambia’s legitimate head of state. The next day, once it was clear that virtually all of his allies had abandoned him, Jammeh finally agreed to a deal that would take him into exile in an unnamed third country.

At around 9 p.m. on Jan. 21, Jammeh departed Banjul for the Guinean capital of Conakry. From there, he reportedly continued on to Malabo, the capital of Equatorial Guinea, which is not party to the International Criminal Court. Photos taken at the airport in Banjul showed him grinning sheepishly out the window as he waited to take off.

Not long after Jammeh departed, the U.N., AU, and ECOWAS issued a joint statement saying that the former president should be free to return to Gambia in the future and that any nation showing him “African hospitality” should not be sanctioned or punished. The statement also committed all three organizations to working with the new Gambian government “to prevent the seizure of assets and properties lawfully belonging to former President Jammeh or his family and those of his Cabinet members, government officials and Party supporters.”

The communiqué doesn’t impose any legal obligations on the new Gambian administration, however, and Barrow has since referred to it as “a resolution … not an agreement.”

The swift resolution of the Gambian crisis stands in contrast to similar African mediation efforts where leaders have defied term limits or otherwise sought to remain in power indefinitely. In Burundi, for instance, the AU Commission failed to convince President Pierre Nkurunziza not to stand for a controversial third term. Later, the AU backed away from a proposed peacekeeping force to protect civilians when the country descended into chaos. Initial support for the mission — dubbed MAPROBU and authorized by the AU’s Peace and Security Council — evaporated when it was tabled at the larger General Assembly, composed of African heads of state.

But the Gambian crisis differed from the Burundian one in important ways. Gambia has one of the continent’s smallest militaries, whereas Burundi is a significant troop contributor to various AU and U.N. missions. Historically, ECOWAS has also proved more willing to support regional military operations than the East African Community (EAC), which played a leading role in mediating the Burundian crisis.

But the most important difference may have been Jammeh’s poor relations with his neighbors. The erratic Gambian president has antagonized Senegal in particular by supporting separatist rebels in its southern Casamance region. His willingness to let illegal logging operations in Senegal export rare hardwoods through Gambia has also irked his neighbors.

“Senegal didn’t waste time. As soon as Jammeh rejected the election results, President Macky Sall jumped ahead to call on the United Nations Security Council for its support in ensuring Jammeh stepped down at the end of his term,” said Abdul Aziz Bensouda, the secretary-general of the Gambia Bar Association, who emphasized that he was speaking in a private capacity. “Jammeh’s weakness was Senegal’s strength.”

Jammeh’s unpopularity no doubt factored into ECOWAS’s decision to unite behind Barrow. “The region was long fed up with having an unhinged character on its doorstep,” said Jeffrey Smith, the executive director of Vanguard Africa, a nonprofit that supports democratic transition and is advising Gambia’s new coalition government. “If you look across the borders, other West African countries have made huge advancements while Gambia was going backwards.”

That view contrasts sharply with Nkurunziza’s position within the EAC, where he still enjoyed considerable support at the beginning of the Burundian crisis. As a result, neither the EAC nor the AU passed judgment on his legitimacy after his disputed re-election in 2015. In Jammeh’s case, both ECOWAS and the AU said they would no longer recognize him, at which point it was “game over,” according to Paul D. Williams, an associate professor of international affairs at George Washington University who writes frequently on peacekeeping in Africa. From then on, it was “all about the AU maintaining its line on unconstitutional changes of government.… United political diplomacy plus enough threat of military force did the job.”

But if much of what made it possible to remove Jammeh peacefully was unique to the Gambian situation, the trend toward more aggressive democracy promotion among West African states was not. Countries in the region increasingly “like to demonstrate their democratic credentials by pushing democracy in the region,” said Nic Cheeseman, a professor of democracy and international development at the University of Birmingham. “This is not an outlier but fits into a pattern in which Nigeria has consistently held other West African states to standards that it has not always lived up to itself.”

The fact that so many of the countries that played key mediation roles in Gambia are — or at least see themselves as — functioning democracies highlights another lesson with broader relevance in Africa: Where the interests and values of regional powers are aligned, enabling them to act in concert, they are much more likely to succeed.

It is for this reason that easing Jammeh out of power may prove much easier than holding him accountable for his many crimes. The same communiqué that committed the AU to helping Jammeh and his cronies keep their assets strongly implies that none of them should be subject to prosecution. (Jammeh, after all, was not the only corrupt autocrat with a seat on the continental body.) Barrow, for his part, has sounded a conciliatory note toward his predecessor’s administration.

“We aren’t talking about prosecution here,” the incoming president told The Associated Press. “We are talking about getting a truth and reconciliation commission.”

Hunt reported from Banjul. McCormick reported from Nairobi, Kenya.

Top image: ALAIN JOCARD/AFP/Getty Images