DROP a pin on a map of eastern Africa and chances are it will not land on a healthy democracy. Somalia and South Sudan are failed states. Sudan is a dictatorship, as are the police states of Eritrea, Rwanda and Ethiopia. President Yoweri Museveni of Uganda has ruled uninterrupted since 1986, and plans to remove a constitutional age limit so he can cling on longer. Elections in Tanzania have never ousted the Party of the Revolution (and its predecessor), which has governed since independence in 1961. Even Kenya, once the region’s most vibrant and competitive democracy, is struggling. Last month Uhuru Kenyatta was re-elected president with 98% of a preposterously flawed vote. In this context tiny Somaliland stands out. On November 13th citizens of this internationally unrecognised state will elect a president in what is expected to be its sixth peaceful, competitive and relatively clean vote since 2001. This unparalleled record makes it the strongest democracy in the region. How has this happened?

A peculiar history helps. Somaliland was a British protectorate, before it merged with Italian Somalia in 1960 to form a unified Somalia. It broke away in 1991, and now has a strong sense of national identity. It was one of the few entities carved up by European colonists that actually made some sense. Somaliland is more socially homogeneous than Somalia or indeed most other African states (and greater homogeneity tends to mean higher levels of trust between citizens). A decade of war against the regime of Siad Barre in Mogadishu, Somalia’s capital, reduced Somaliland’s two largest cities to rubble, yet produced a flinty patriotic spirit. And the Somali National Movement (SNM), which led the fighting, cultivated an internal culture of democracy. Its leadership changed five times in nine years, and transferred power to a civilian administration within two years of victory.

But it is the absence of international recognition that may matter most. Muhammad Haji Ibrahim Egal, the president of Somaliland from 1993 to 2002, argued in 1999 that recognition would be dependent on the country’s pursuit of democracy. He proceeded to devise a constitution that was put to a popular referendum in 2001. For fear of encouraging other separatist movements in the region, the international community, following the African Union, has never obliged. But rather than stunting democracy in Somaliland, this response ensured that democratisation moved from the bottom up. Donors often impose democratic reforms on African countries as a condition of financial aid. Since unrecognised Somaliland is cut off from most external assistance, the social contract between government and citizens has become unusually strong. Democracy evolved out of a series of mass public consultations—clan conferences—which endowed it with an unusual degree of legitimacy. The system’s most striking feature is the upper house of clan elders, known as the “Guurti”, which ensures broadly representative government and underpins much of the country’s consensual political culture.

Somaliland’s democracy is by no means spotless. Corruption is endemic, and the media are seldom critical. The influence of the clans has been muted but not eradicated. And elections are repeatedly delayed. The vote on November 13th was overdue by more than two years, and all branches of government have now outlived their mandates. The lower house has sat for 12 years and counting; the Guurti has sat unelected since it was formed in 1993. And there may be even bigger challenges in the future. In the past year Somaliland has signed agreements with the United Arab Emirates to build a new port and a military base at the coastal town of Berbera. The former, valued at over $400m, is the country’s largest-ever investment deal. Nation-building on a shoestring helped keep Somaliland’s politicians relatively accountable, and helped to keep the delicate balance between clans. But this may not be the case for much longer.