2016 has seen more electoral upsets than any other year in recent memory. First, the United Kingdom voted to leave the European Union. Next, the United States elected Donald Trump as its president, shocking the world. But what may be the most shocking election result of the entire year is in neither of these countries. Instead, it is in continental Africa’s smallest country, the Gambia, where Adama Barrow defeated the incumbent Yahya Jammeh in the country’s presidential race. Unlike the elections in the United Kingdom and the United States, which were largely the culmination of long-term political trends in The West, the election in the Gambia stood in complete contradiction to recent African political trends. The drama that has unfolded over the two weeks following the decision, however, is very much in line with the trend that the election itself so shockingly rejected.

In triumphing over Jammeh, Barrow achieved something that seemed impossible: he defeated a dictator in an election. In the context of African politics, that almost never happens. In February, Uganda’s Yoweri Museveni easily secured re-election for the fourth time. In March, the Republic of the Congo’s Denis Sassou Nguesso won re-election after changing the country’s constitution to allow him to run for a third term. In April, Africa’s longest serving president, Teodoro Obiang Nguema Mbasogo of Equatorial Guinea, further extended his time in power by triumphing in his country’s elections. In September, the incumbent president’s narrow margin victory sparked nationwide protests and justified allegations of fraud in Gabon. Across the continent, autocrats frequently stage elections to project an air of legitimacy. But they never lose them.

So how did Jammeh lose his? In order to understand how Barrow triumphed, it is necessary to understand why and how fraudulent elections are held in the first place. The purpose of these elections is to act as a cushion against accusations of dictatorship. Leaders hold elections in order to gain legitimacy. As a result, they often try not to make them blatantly rigged, and they often permit a certain degree of opposition to maintain the illusion of democracy. Take the example of Gabon’s election in September. Gabon’s leader, Ali Bongo, is widely considered an autocrat. Yet he does not use traditional dictatorial tactics to remain in power. He allows opposition and is far less repressive than Jammeh. Instead, he maintains power by building institutions that favor his rule. He controls the media, has staffed his government with friends and family, and has filled the courts with loyalists. As a result, he didn’t need the population’s approval to win the election.

Jammeh uses the very same tactics as Bongo, except he even takes it a step further and imprisons the opposition. As a result, he likely felt incredibly confident about his ability to win the election. After triumphing by a huge margin in 2011, it is not surprising that he told the BBC that he would rule for “one billion years.” When the media, the military, and most of the government is loyal to a ruler, electoral victory seems like a given. So Jammeh probably didn’t feel the need to prepare for an elaborate rigging of the vote. He would simply let his political dominance do the job. But considering that the opposition was united for the first time, youth unemployment is high, and thousands of Gambians are leaving the country for Europe, political dominance was not enough. The voters decided that it was time for a change.

And in what was probably the most shocking event of the last few weeks, Jammeh conceded. His loss is explainable when factoring in foolishness, but his concession truly baffled the world. In a country where he could have chosen to remain in power had he truly wanted to, it seemed almost as if Jammeh was willingly ceding control. The situation seemed unlike any that an African country had faced in years. In a continent where many leaders are holding fraudulent elections or attempting to remove constitutional term limits, here was a dictator of 22 years who was willingly choosing to give up power peacefully! What a relieving break from recent political trends! Or not. A little over a week after the election, Jammeh recanted his concession.

And so the Gambia’s break with the mainstream broke down as Jammeh called for new elections and deployed troops into the streets of Banjul, the country’s capital, and Serrekunda, its largest city. In doing so, he plunged the Gambia into a period of uncertainty. Jammeh has the backing of the Presidential Guard, but Barrow has the backing of the people and of the international community. As a mediation effort led by various West African heads of state failed, fears are rising that the Gambia is headed towards violence. Some have warned of the risk of civil war, and there has been talk of foreign military intervention by other West African states. Jammeh’s unpredictability has forced his country into a very difficult predicament.

Three weeks ago, this blog published an article entitled What to Know Ahead of Thursday’s Election in The Gambia. Now, it is clear that the contents of that article were not enough to truly make sense of the drama that has plagued the Gambia over the past few weeks. In truth, no amount of background information can confidently predict the outcome of this crisis. Jammeh has shown that he really, really does not want to leave office, and he fears that he will be prosecuted by a Barrow administration. That can be said for certain. But his inability to effectively rig the election has left him cornered. And if Jammeh was incredibly unpredictable before he was cornered, it is difficult to imagine what he will do now that he is.