Yesterday’s presidential election made many follow the news from Dakar with concern – and eventually with great relief. It was the run-off in a tense campaign that pitted incumbent president Abdoulaye Wade against Macky Sall, a former prime minister who worked with Wade for years but nonetheless offered an awaited opportunity for change after more than a decade of Wade’s rule.

The run-off made observers nervous given the unrest that followed the controversial ruling in January that allowed the president to run for the third term despite the constitutional two-term limit. The high court’s argument was that the Constitution changed during Wade’s first term in office and therefore that term did not count toward the allowed total. But many Senegalese were not satisfied with that explanation and violent protests followed, leaving several people dead and over 100 injured.

Aside from the constitutional question, the reasons for popular discontent were many. Wade, 85, was becoming increasingly out of touch with the needs of the country where 60 percent of the population are under 25. Crucially, he failed to deliver when it comes to providing economic opportunity for the country’s youth. In the capital Dakar more than 43.9 percent of young people aged 15–24 work in the informal sector, with many trying to illegally immigrate to Europe or forced into the life of crime. In this context, the president’s decision to spend $26 million on the African Renaissance Monument – a gigantic 164-feet-high bronze statue unveiled on the outskirts of Dakar in 2010 – felt like a vanity project draining funds that would have been better spent on pressing social issues. The image of this venture was further tarnished when Wade casually remarked that that 35% of all tourism revenue from the Monument should go to him.

His popularity also suffered after an incident involving the president handing an IMF official a suitcase with $200,000 as a “parting gift,” which he later claimed to be a mistake by an over-zealous aide. And he was widely perceived to be grooming his son, Karim, already in charge of powerful government posts, as his successor.

All this baggage did not bode well for the Sunday elections, with many fearing that Mr. Wade had embarked on the path of “imperial presidency” – a well-known pattern in Africa – and would contest the results in order to stay in power even if it meant throwing Senegal into civil unrest. Yet, to the widespread relief both domestically and internationally, he promptly acknowledged his electoral defeat, calling to congratulate Sall a few hours after the polls closed.

In the end, Wade acted like a statesman mindful of his legacy, turning what many feared would be the day of chaos into a triumph of democracy. Senegal’s democratic traditions stretch back 900 years to the Waalo kings who held elections in contrast with most other African chiefdoms where the power was passed from father to son. And while most other countries on the continent only began experimenting with democracy in the post-colonial era, Senegal had already held regular elections since the mid-1800s when it began to elect a deputy to the French parliament. Since the independence in 1960, Senegal has been one of the most democratic and stable countries in West Africa – the only one in the region that has never experienced a military coup.

The Sunday vote reaffirmed the country’s democratic credentials, and a peaceful presidential election certainly is welcome news, especially coming just days after the coup in neighboring Mali overthrew its democratic government. As sociologist Hadiya Tandian put it, “It shows that the Senegalese believe in their voter IDs, that a voter card can change something, can make a difference. It shows that our long democratic heritage continues to live in us day by day.”