On Saturday 13 August 2016, six bodyguards from the protection detail of the Gambia’s president, Yahya Jammeh, squeezed into a rental car and drove to the sprawling coastal town of Serekunda. They stopped in Senegambia, the capital’s famous party street, where music blares from bars and white tourists walk around in flip-flops hand-in-hand with young lovers. The men drank some juice and nibbled at some food as they awaited nightfall.

At 1am, when they considered it was safe to move, they got back in the car and drove towards the headquarters of Jammeh’s ruling party, the Alliance for Patriotic Reorientation and Construction (APRC). They stopped a little distance from the building and peered through the darkness. The building seemed empty. After circling it twice they parked the car 300 metres away. There was only one guard, in a small shed close to the entrance.

The guard, taken by surprise, was tied up and gagged, and four men kept watch while two entered the building. They knew what they were looking for, but they overturned shelves and tables and threw items around the room to make their visit look like a random act of vandalism.

In another room, they piled chairs and computers in the middle of the floor, with folders, binders and papers. On top of the pile, they placed what they had come for: three cardboard boxes containing ID cards for citizens registered to vote. The guards had intelligence that fake IDs would be given to foreigners paid to vote for the ruling party. Rather than dislodge the president by force, the guards would try to stop him rigging the election. One of them poured petrol on the pile, the other took out his lighter and set the heap ablaze.

It was one of several small steps that would culminate in the toppling of one of Africa’s strangest and most enduring dictators. During his 22-year rule, Jammeh treated this impoverished, elongated west African country as his personal fiefdom. He liked to drive at speed across the country in his motorcade, throwing biscuits and money to the crowds from the sunroof of his Hummer limousine – a stunt that killed and injured several of his citizens. He had sworn to rule “for a billion years”, and had held elections every few years to give his dictatorship a gloss of legitimacy, after suppressing any opposition. His intelligence service infiltrated every layer of society, and his personal militia, the Jungulars, made critics, journalists and political opponents disappear.

The regime had made clear its willingness to shut down public demonstrations of dissent with lethal violence. In 2000, when hundreds of students from the national university marched through the streets of Banjul to protest the alleged rape of a 13-year-old girl by a policeman, Jammeh’s security forces opened fire. Fourteen students and one journalist were killed, and the crackdown sent a clear message to the Gambian people: anyone who challenged the regime would be punished.

Robbed of freedom and opportunities, many young Gambians preferred to face the dangerous Mediterranean crossing rather than stay put in the police state that the Gambia had become under Jammeh. In 2016, around 12,000 Gambians landed on the shores of Italy and Greece – proportionally more than from any other African country. But some stayed to fight back. In the face of violent repression, an unlikely mix of rebels in small cells inside and outside the Gambia orchestrated an uprising. One group put together a playbook for how to bring down a dictator, a 25-page document that included instructions on how to build a campaign, effective text messages to motivate demonstrators, and guidelines on how to unite the opposition.

After changes to the electoral law in July 2015 made it prohibitively costly to stand as a candidate, the phoney election scheduled for December 2016 became the focus of protest. The determination to break Jammeh’s grip on the Gambia was long years in the making, but the final push took just five months. A few of the protagonists lost their lives in the process, but some survived to tell their story.

When Jammeh first took power more than two decades earlier, he didn’t represent any party or ideology. Then only 29, he had been in charge of the bodyguards protecting the country’s first and only president, Dawda Jawara, who had ruled since the Gambia gained its independence from the United Kingdom.

Samba Faal, who was then the vice-mayor of the capital of Banjul, still remembers the hot summer day in July 1994 when he watched a company of armed soldiers, led by Jammeh, marching toward the presidential palace. Taking advantage of the president’s absence on a trip abroad, Jammeh and his comrades seized power in a bloodless coup.

Jammeh’s timing was good. Jawara had held the presidency since 1970, and Gambians had grown weary of his rule. Corruption was endemic, and the president’s friends had grown rich. “Jammeh was a simple opportunist with a plan,” Faal said. Jammeh criticised the president’s foreign backing – Jawara had studied in the UK, and retained close ties with the west – and portrayed himself as a poor man from rural Gambia, a man of the people.

Observers disagree about how politically astute Jammeh actually was. Today many Gambians refer to him as an imbecile, who was destroyed by hubris. But among people who worked closely with the dictator, there is a sort of respect for his abilities. “He had a good tactical understanding,” says a senior western diplomat. He might not have possessed an ideological compass or a plan for how to govern, the diplomat implied, but he took power with perfect timing and he knew how to hold on to it.

Shortly after he took control, Jammeh ordered the executions of about a dozen high-ranking soldiers whom he considered threats. He was aware that the first period of a dictator’s rule is the most uncertain. According to The Dictator’s Handbook, by political scientists Alastair Smith and Bruce Bueno de Mesquita of New York University, a dictator has a 50-50 chance of surviving the first six months in power. For Jammeh, those odds looked pretty good. As the son of a semi-professional wrestler and a street vendor, few people would have put money on his ascent to the presidency.

Yahya Jammeh at a rally in Banjul, the Gambia, in 2016. Photograph: Thierry Gouegnon/Reuters

Jammeh was not always regarded with suspicion and fear. But throughout his reign, he became increasingly eccentric and high-handed, and his citizens began to believe he had lost the plot. Fatou Jatta, who encountered Jammeh for the first time in 2007, was one of the first Gambians to publicly disclose that she was HIV positive, had been instructed to come to the presidential residence in Banjul. She and a group of eight other HIV-positive men and women were to begin a course of treatment devised by the president. He wore a flowing white gown, and asked politely for her to take off her clothes and lie down. “It wasn’t a good massage,” Jatta remembered. “He wasn’t a good masseur. But then again, his day job was president.”

Each submitted to Jammeh’s massage and then gathered on the grandiose porch to take their medicine: a glass of green fluid, which he administered in person. Jatta never discovered what it contained. The first time they drank it, everyone vomited, but they learned to keep it down – under the stern glare of rifle-bearing soldiers.

The patients returned for their treatment every morning for nine months. The treatment was the invention of the president himself, and he paraded his medical breakthrough to the international press, while insisting that his recipe remain a secret, “like Coca-Cola”, he said.

An estimated 9,000 HIV-positive Gambians were forced to abandon conventional medicine in favour of Jammeh’s homemade recipe, according to the US-based NGO Aids-Free World. Not only did Jammeh insist he could cure HIV, he also appeared to believe he was immortal. He kept lions as pets and buried the bodies of his enemies in his backyard. He also drained the country’s economy.

It would be difficult to say that Jammeh’s economic plan failed: there never seems to have been an actual plan. The economy has floundered under his rule; the economist Nyang Njie estimates that inflation has run at between 20 and 25% in the past five years.

The Gambia has no mineral wealth, but there are always vital functions that can be exploited for profit: infrastructure, water, electricity. The takeover of these services became Jammeh’s path to wealth. “It is difficult to grow an economy: it requires skill, luck and the right circumstances,” Alastair Smith says. “It is, however, easy to cannibalise by extracting rent wherever it is possible.”

The Gambia never achieved viable exports under Jammeh; instead, the country was used as an export corridor for illegal goods. The Gambia’s rocks are barren of diamonds, yet by 1998 the country had become one of the world’s biggest diamond exporters, and diamonds made up 62% of all of Gambian exports. At this time, in nearby Sierra Leone a civil war was raging, and diamonds from the country were declared “conflict diamonds”, which were not allowed to be sold on the international market. When a peace deal was struck in Sierra Leone in 2001, Gambian diamonds fell to below 1% of the country’s exports in the span of two years.

Jammeh amassed enormous wealth, and stashed it outside the country. The Gambian ministry of justice is still working on getting hold of deeds to 130 properties worldwide, 88 bank accounts and 14 companies that had close dealings with him. Jammeh had at least two Rolls Royces and several limousines as well as his customised Hummer. Shortly before he abdicated, a cargo plane transported six of Jammeh’s luxury cars out of the country, according to the New York Times.

In contrast to the president’s immense wealth, nearly half of the Gambia’s people lived on less than $1.25 a day, according to the World Bank. For most of his reign, a third of the population was officially unemployed; among young people, it was nearly half. After the crackdown on the student protest in 2000, people knew it was unsafe to voice their discontent, but popular dissatisfaction was growing.

Malick Sandeng, a 29-year-old from Banjul, had many times considered embarking on “the backway”, as the migrants’ journey to Europe is known, but he is painfully aware of how hard migrants’ lives are. “Their Facebook photos tell a story of fun and plenty, but when I talk to them on WhatsApp they tell me they sleep on the street and rarely eat, so they can send money home,” he says. It was his father who persuaded him to stay. “He told me Jammeh wanted us to leave, so there would be fewer men left to fight him,” Sandeng says. “I stayed, and look what happened.”

Sandeng’s father, Solo, was an unlikely hero. A dreamer, a good listener and a family man, he was judicious and plain-speaking, the kind of man people came to with their problems and quarrels.

Shortly before sunrise on 14 April 2016, he gathered his wife, Nyami, and a couple of their oldest children, for a morning prayer. It was unusual for them to pray together. Thinking back, Solo’s oldest daughter, Fatima, saw something tense in her father that early morning. “When we had finished our prayer he pulled me aside and asked me to watch over the family, no matter what happened,” she said.

In the Sandeng house in Banjul, there is a box of old photographs. In photos with his nine children, Solo is smiling. Alone, he looks serious and deep in thought, even when he’s staring into the lens. That was the face Nyami fell in love with when she saw Solo the first time outside the mosque, three decades earlier. She saw the serious face, the bushy eyebrows, and “those eyes”, Nyami said, smiling. Her description continued, but her daughter stopped translating and rolled her eyes.

In 1996 Sandeng joined the United Democratic party (UDP) – the first political party formed in opposition to Jammeh. He was among the first party members, but he kept away from the grand stage. Instead, he became a mobiliser, a job that included trying to attract new UDP members and stir up opposition to the president. Sandeng’s role was to talk politics in a country where talking politics was highly dangerous.

Sandeng started receiving threats, which grew in frequency and severity as Jammeh gradually stopped pretending to be a democrat. Shadows started following Solo wherever he went, his brother Abbas remembers. “NIA [the secret police] would show up at any hour ‘to check on us’,” Abbas says. “They stopped him at the strangest times and flung accusations at him.”

Sandeng had planned a protest on 14 April 2016, as a reaction to Jammeh’s newest change to the electoral law. There were just eight months until the next election. The new rules raised the price of running for president to a million dalasi (about £15,000) – 40 times the yearly income of the average Gambian. Holding a white sheet with thin red letters spelling out the polite message “We need proper electoral reform”, a small group of protesters marched towards Westfield Junction, a three-way intersection in Serekunda.

They reached their destination just as the police arrived. Kifa Barhama, a journalist, filmed what happened next on his phone. The protest quickly escalated into a heated argument between the protesters and the police, with Sandeng at the centre of the chaos. Police reinforcements arrived, batons swinging. Protesters were beaten and thrown on to a waiting truck. A policeman pushed Sandeng into a car. Through the window, the video caught Solo’s last words, before the cab drove away.

“I’m arrested. They will kill me.”

The prisoners were taken to the intelligence service headquarters in Banjul. Reports from Amnesty, Human Rights Watch, and the UN paint a picture of a force that routinely used torture including, but not limited to, beatings, electric shocks, strangulation, fire, simulated drowning, rape and burying people alive.

Nogoi Njie and Fatoumatta Jawara, two female protesters who were captured with Sandeng, later testified about what they had seen. “The torturers wore black hoodies and gloves and the only identifiable features were their eyes,” said Njie. Three teams of four to five men took turns beating her, while hosing her with cold water. Afterwards she was put in a dark room with a heavy stench of urine. Five minutes later, Sandeng was thrown into the same room. His body was swollen and he was bleeding from the face. Njie massaged him and he fell asleep.

But his rest was cut short as someone started shouting his name from the hallway. Sandeng rose, and was taken out of the cell. Before long, Njie heard him screaming. He was never seen alive again.

Almost a year later, Solo Sandeng’s body was found buried in the bush on the outskirts of a fishing village 30km along the coast from Banjul. But even before his fate was known, Sandeng’s disappearance ignited the opposition. A few days after his detention, a group of opposition leaders and activists marched through the streets of Serekunda to demand information about Sandeng’s whereabouts. Jammeh responded swiftly by jailing the UDP leader Ousaino Darboe, his main rival, and 18 other protesters.

But it turned out that removal of Darboe gave a new lease of life to the anti-Jammeh movement. Among the experienced campaigners was Fatoumata Tambajang – a well-respected older woman with a career in the UN behind her and a clear plan on how to unite the opposition. For seven years she had chaired meetings with Darboe and other leaders in an attempt to get them to rally behind a single banner. But on every occasion they would reach a stalemate: “They couldn’t understand that it was impossible for everyone to become president. Actually the imprisonments gave us an opportunity,” says Tambajang, who is now vice-president.

For the first time ever a coalition was in the making. But they were in need of a candidate.

Meanwhile, the president was facing growing discontent within his own ranks. He felt it necessary to fire several high-ranking members of his cabinet. And even his own bodyguards were tiring of him. Seoul Badjie (not his real name) had been a bodyguard in the unit in charge of Jammeh’s safety since 2011. He would open the door for the president whenever he wanted to enter or exit his office, and sit next to him in the Hummer limousine.

Yahya Jammeh campaigning in Farafenni, near the border with Senegal, May 2016. Photograph: Bangaly Toure/Alamy

“The closer we came to Jammeh, the more dissatisfied we became,” Badjie told us while sipping a Malta soda at a cafe on the outskirts of Serekunda. Whenever the president was in a foul mood, Badjie recalled, he would yell at his guards, hit them, or lock them in a dark room for days. Badjie developed a friendship with five other guards, who shared his dissatisfaction. During the summer of 2016, their late-night chats reached a point where they were actively discussing how they could bring about the end of Jammeh’s rule. They discussed the possibility of an armed coup, but decided it was too risky.

If they couldn’t overturn the regime by force, the group decided, they would try to tackle the corruption that enabled Jammeh to hold on to power. The guards were in a perfect position to gather information. At the end of July, one of the bodyguards overheard an official telling Jammeh that a batch of fake voter IDs intended for the upcoming election had arrived, and were being stored at the party headquarters in downtown Serekunda.

Although Jammeh had held several elections during his rule, on the Economist Intelligence Unit’s democracy index, by 2016, the Gambia had become a full-blown autocracy, less representative than Zimbabwe or Cuba. There is nothing democratic about elections in an autocracy.

“Jammeh would harass the opposition leading up to elections, and he would send troops to areas where he knew he was unpopular,” said Amadou Scattred Janneh, former minister of information in Jammeh’s government. “He used the elections to give the impression that he was chosen by the people.”

In common with Vladimir Putin, Kim Jong-un and Bashar al-Assad, instead of abolishing elections, every five years Jammeh had held elections which his party typically won by around 70% of the vote. The Economic Community of West African States (Ecowas) condemned the “repression and intimidation” of voters. It has never been proved that Jammeh cheated with voter registrations, but the opposition parties have claimed for years, and international election observers suspected, that Jammeh’s party machine issued fake IDs to citizens from Senegal and Guinea-Bissau, who were paid to come and vote for him. The small size of the Gambia’s electorate (in 2011, fewer than 800,000 people had registered to vote) meant that even a small margin could be decisive.If the fake IDs the ruling party intended to distribute to foreign voters were somehow destroyed shortly before the election, Badjie and his small group of bodyguards figured, the ruling party wouldn’t have time to make new ones.

Thus it was that the six men rented a car and equipped themselves with a can of petrol, and late at night on 13 August, parked in the darkness outside the APRC HQ. The plan was to destroy the fake registration cards and escape the country before they could be apprehended.

After the fire was lit, the flames quickly caught. The men took different routes out of the building, ran back to the car and drove out of the city. The plan had gone perfectly. The fire destroyed two offices, but not the whole building. No one had been hurt and the saboteurs evaded capture. The registration cards were turned to ashes and it was too close to the election to have new ones printed.

After the attack, the six bodyguards fled south to the border, and ran through the bush in pairs until they crossed into Senegal. They managed to get to Dakar, where they would wait. Here, they found other Gambians who were also working to bring down Jammeh, one text message at a time.

Jammeh’s excesses had inspired no fewer than five failed attempts to oust him. Senegal, which surrounds the Gambia almost entirely apart from its 80km coastline, had become home to many Gambian exiles fleeing arrest or violence. A radio station based there was broadcasting anti-Jammeh propaganda back into the Gambia via the internet. And in the months leading up to the fire at the ruling party HQ, dissidents in exile had been finding their voice.

One of the loudest and most influential dissident voices at that time was that of the rapper Ali Cham, AKA Killa Ace. He had grown up in the Bronx, New York, and started rapping at the age of 12. By the time he was 15, in 1999, his parents feared he would become involved in gang violence and decided to send him to the Gambia, where they had both been born, and where Ace would stay with relatives. Once he got to west Africa, his lyrics continued to reflect preoccupations of life in the Bronx – getting rich and dating “fly females”. But in the Gambia, he quickly realised it was trivial to rap about women and cars when people were being tortured for voicing their opinion. His lyrics gradually changed as Killa Ace started rapping about politics, police brutality and inequality, although he still cloaked his message in metaphors.

“You knew what he said was critical, but you needed a dictionary to figure out what he meant,” Lamin Sey, Cham’s manager, said. But then in 2015, during a tour in neighbouring Senegal, Cham decided that he needed to speak out about what he really thought of his president.

“The essence of being a rapper is to represent the people in my environment. I’m the biggest rapper in the Gambia, and if I didn’t speak up, I might as well have quit,” he said. He put out a song called Ku Boka C Geta G (roughly translated: “if you’re part of the herd, you’re entitled to drink the milk”), on Facebook, criticising the president by name, accusing him of taking money from the people and spending it abroad, on his celebrity friends.

Explicitly naming Jammeh in a song for the first time was a life-changing decision for Cham. Soon after, he became a hunted man. When he returned from his tour, the NIA were looking for him, and he went into hiding. Every day, unknown numbers called his mobile phone. At the same time, his mother called from New York trying to persuade her son to leave the Gambia.

“She told me that what we had done with Ku Boka C Geta G was brave, but if I wanted to spread the message I could do it better from Dakar,” he said. The following night, Cham fled with his wife and daughter to the Senegalese capital. The city was full of Gambian exiles and some were putting together plans to bring down the government. One of them was an IT company director, Abdurahman Touray, who had fallen out of favour after the president made him a takeover offer that he refused. Touray had fled to Dakar in 2010, and quickly became part of a group he referred to as the Resistance. “I am a freedom fighter,” he told us, without smiling, when we met him in his office outside Banjul last year. (Sadly, Touray did not live to see his free country take shape: he died after an illness in March this year.)

From a house on the outskirts of Dakar, Touray coordinated the fight against Jammeh. The self-styled Resistance put together a document detailing, step by step, how to bring down the dictator, titled Blueprint for a New Gambia. It was inspired by the Serbian activist Srđa Popović, who helped bring down Slobodan Milošević in 2000 and subsequently wrote a book called Blueprint for Revolution. “A revolution is not the result of a people having hard-hitting ideas and fiery passion,” he told us. “A successful revolution comes down to planning.”

Blueprint for a New Gambia suggested questions the people should be asking about the president’s conduct, and his income. It went as far as to outline a plan of action for the hours after Jammeh’s fall from power: which generals should be taken into custody, how military arms should be seized. It details how Jammeh, once detained, should be kept on a minimum-fat, low-sugar diet to make sure his diabetes didn’t kill him before he got to trial.

But the essential factor in getting the operation up and running was money. “My first advice to any aspiring freedom fighters would be to secure a steady flow of financing,” Touray explained. He estimated that the whole operation ended up costing around $10m. The Gambian diaspora is large, and provided a combination of crowdfunding (including donations of as little as $20) and large single donations (including one of $50,000 from a wealthy Gambian expat in the US).

Inspired by the French partisans of the second world war, the Gambian resistance organised itself into autonomous cells, which operated without knowledge of what other cells were doing. To keep them from colliding, a small number of people had the whole picture. More than 15 cells were operating out of Sweden, the UK and the US. Senegal was home to Touray’s cell, and Killa Ace’s – which was the largest and most active, and had the name Team Gom Sa Bopa (“Believe in yourself”). Between the rap star’s mobilisation abilities and Touray’s IT skills, they came up with a new tactic to take their revolt to the next stage: viral text messages to get protesters on to the streets.

Ace composed emotional and inspiring messages about the murder of Solo Sandeng, while Touray figured out how to get them to the widest possible audience. Touray had a phone number database that included subscribers to the largest telephone carriers in the Gambia. He dodged my question about how he obtained it – just raised an eyebrow and gave a rare smile.

“Around Solo’s death, we rallied people to show up at protests. And because people knew that others would show up, due to the texts, they took the chance themselves,” Touray said. “It was Solo’s idea to protest, but we would carry on his legacy. We weren’t going to stop.”

Encouraged by text messages from the Resistance, Gambians were emboldened to take to the streets in several rounds of protest in the months leading up to the election. Jammeh felt it himself when he encountered citizens on the campaign trail. For the first time, he was booed while parading through villages. At a rally in the northern town of Farafenni one month after Solo’s death, he lost patience with the irreverent reception he was suddenly getting. From the stage he abused the crowd: “I know you people don’t like me. There are people in this country that pretend to like me even though they don’t. You are like those,” he yelled from the podium, adding for good measure that the opposition would be buried nine feet deep.

With just a month to go before the election, the opposition found their candidate: the UDP treasurer, Adama Barrow, an unassuming figure who had for a time worked as a security guard in London.

On 1 December 2016, election day, a little more than half a million people – or 60% of registered voters – turned out. As the votes were counted, it dawned on Jammeh and the population that his plan to rule for a billion years might prove exaggerated. Gambian journalists didn’t know what to report. They rarely published stories that didn’t fit the narrative of the regime, and if they did, repercussions were severe. To find answers, reporters gathered in front of the offices of the Independent Electoral Commission.

Adama Barrow greeting supporters in Talinding, the Gambia, November 2016. Photograph: Marco Longari/AFP/Getty Images

In his office, the commission’s 82-year-old chairman, Alieu Njai, sat and worried. As chairman, he was in charge of the final count. On his table, a fax machine was churning out fresh results from the districts. Njai would gather five or six pages, walk down the stairs, and announce the results to the waiting press.

As regional results accumulated, he realised that the president might lose. And so did the president’s office. An official called him and told him to stop making any further announcements of results as they came in. By way of a response, Njai went out and parked his car just outside the commission’s main gate, ready for a quick getaway. Then he went back up to gather more results from the fax machine.

“Jammeh thought he could trust me 100%. But I had 0% trust in him,” Njai recalled. At the next announcement, journalists from the state-owned TV-station asked him to stop. Njai continued defying orders. In a last, desperate move, Jammeh cut off the country’s connection to the internet and international phone network to keep the Gambian people from learning the result, but the results were shared by word of mouth.

In Serekunda, cars with blaring horns were racing through the streets; yellow flags, Barrow’s colour, fluttered in the night sky. In Senegal, Badjie and his group of former bodyguards, Cham the rap star, and Abdurahman Touray prepared to return home. The dictator had fallen.

Jammeh conceded to the opposition leader, Adama Barrow, but two weeks later he was still in place, and showed no signs of vacating the presidential palace. His party was attempting to force a rerun of the election. In the days that followed, the Gambia felt as if it could be on the brink of civil war. The streets were empty except for soldiers behind sandbags at the major intersections. Fearing that the army would crack down on the people or that different army factions would turn on each other, more than 45,000 Gambians fled to Senegal.

Late one night in mid-December, Killa Ace’s manager, Lamin Sey, spray-painted a message on a wall in downtown Serekunda: #GAMBIA HAS DECIDED.

Five days earlier – two weeks after the vote had gone against him – Jammeh had declared the election invalid. In the village of Basse, in eastern Gambia, an error had occurred in the vote count: a column shift in Excel had misallocated the candidates’ votes. The entire election would have to be rerun, Jammeh argued, and instructed the supreme court to arrange it. But he had fired several of the judges a few months earlier, and it would be months before new ones could be flown in from Nigeria and sworn in. Jammeh had decided to stay in power until then.

#JAMMEH MUST GO, Sey wrote, on another stretch of wall. As he closed the circle of the last O, a beacon of light hit him from behind. He spun around and stood face to face with a police officer. He was convinced he would be going back to prison. “I was shit scared,” he told me.

“Your friends who kept watch ran off,” the police officer said. “You should get some new friends.”

The officer turned and rode off on his bike, leaving the terrified Sey alone in the dark. It seemed the balance of power had finally shifted.

Opposition newspapers wrote that Jammeh had imported mercenaries from Sierra Leone and other west African countries. Both Jammeh and the opposition were hoping for support from Ecowas, the organisation for economic cooperation established by 15 west African states. In previous years, Ecowas states had sent joint military forces to intervene and secure peace in conflicts in Mali, Sierra Leone and Ivory Coast.

On 15 January, Jammeh went on live television, and the Gambian people were able to watch him picking up his phone to make a call to Ellen Johnson Sirleaf, head of Ecowas and president of Liberia at the time. He asked her for Ecowas’s help in blocking Adama’s inauguration. Johnson listened carefully before answering.

“As I’ve told you before, it would be better if you write it in a statement,” she told Jammeh.

It was a very presidential brush-off. Jammeh was publicly humiliated in his failure to co-opt a foreign leader to back up his position.

“We have entered Gambia,” an Ecowas colonel texted Reuters in the early morning of 19 January. Nigerian fighter jets circled the presidential palace and Jammeh’s house in Kanilai. The Gambian army, fewer in numbers and with inferior equipment, surrendered.

Jammeh’s attempt to hold on to power had failed. On 22 January, a 10-car motorcade rolled up at the airport in Banjul. It stopped at a red carpet and Jammeh, impeccably clad in white, stepped out and walked to the awaiting plane. A military band played as he waved to a few loyal supporters and assembled journalists. He kissed his Qur’an before he took off.

• Follow the long read on Twitter at @gdnlongread, or sign up to the long read weekly email here.