Senegal's elections have been peaceful and the incumbent president, Macky Sall, has been reelected. For many this comes as no surprise. Senegal has long been a stable democracy in a region plagued by military coups, civil wars and ethnic conflicts. It's been considered an "exception" in West Africa.
Markers of this stability have been visible since Senegal's independence from France in 1960. There was a [peaceful and democratic] transition of power from colonial rule and Leopold Sedar Senghor, Senegal's first president, established a solid democratic foundation. He voluntarily resigned after 20 years in power.
Since then Senegal has had free elections, peaceful transitions of power, and civilian rule.
One of the foundations of Senegal's stability is the strong influence of Sufi Islam. Senegal is 94% Muslim and Sufi Islam dominates culturally, economically, and sometimes politically.
Sufis - Islamic mystics - seek divine love and knowledge through self-discipline. Senegal's Sufis fall under one of the Sunni Muslim schools of jurisprudence.
My insights about the interplay between various Islamic groups, religion and the state is based on my research in the country over the past 20 years. I examined minority Shi'i Islamic communities in Senegal, a majority Sunni Muslim country that has long celebrated religious freedom. The coexistence of various religious groups in Senegal is just one factor that has contributed to peace in the country.
Aside from its religious dynamics, Senegal also has a long history of fostering global intellectual, diplomatic, and financial connections. These have all led to its "exceptional" stability.
To explain the foundation of Senegalese stability, the late Irish political scientist Donal Cruise O'Brien put forward a "social contract" theory. The contract, he argued, was between marabout (Sufi Islamic leader) and talibe (disciple), as well as between the marabouts and the state.
Senegalese historian Mamadou Diouf revisited this thesis in 2013. He touted Sufi Islam as an "antidote to political Islam". This was particularly true, Diouf argued, of the Senegalese model of pluralism, cooperation, coexistence, and tolerance.
But there have been other factors that have contributed to Senegal's stability.
French colonialism positioned Senegal as a port of entry into West Africa. And while Senegal continues to maintain strong ties to Europe and the US it has fostered important relations with the Middle East and Asia.
Senegal is officially a Francophone country. In addition to speaking various African languages, many Senegalese are also Arabophone - intellectually as well as linguistically.
The country developed a diplomatic tradition after gaining independence from France. It joined the United Nations in 1960, the Organisation of African Unity (now the African Union) in 1963 and the Non-Aligned Movement in 1964.
Significantly, Senegal is the only African country to have hosted the Organisation of the Islamic Conference (renamed the Organisation of Islamic Cooperation) Summit twice - in and2008.
Senegal smartly used the opportunity of hosting these Islamic summits to attract significant Arab funding for infrastructural development. For example, it receives the largest amount of loans given by the Kuwait Fund to any African country. Today, Gulf aid has displaced Western development funds in Senegal.
Senegal is also a West African financial centre. It has taken leadership roles in the Islamic Development Bank and was the first African country to embrace Islamic finance.
While these global religious, intellectual, diplomatic, and financial connections have contributed to Senegal's stability, it has experienced periods of instability too.
Not all plain sailing
One example of instability was before Senegal's contentious 2012 presidential elections. The incumbent President Abdoulaye Wade wanted to secure a third term by changing the constitution. The movement "Y'en a Marre" (Enough is Enough) mobilised the youth vote and organised political protests, which disrupted the country for weeks.
Policy commentators first suggested the events might insinuate that Senegal's record of democracy had been weakened. But Wade eventually conceded peacefully to Macky Sall after a run-off election.
Some are concerned that more instability might be looming.
But he has strong critics. His crackdown on corruption has been used politically to eliminate his biggest competitors. And he has been criticised for exiling Karim Wade, son of Abdoulaye Wade, from Senegal and imprisoning Dakar's former mayor Khalifa Sall.
Nevertheless, Senegal looks good in relation to other African countries. Think of the recent elections in Nigeria; Kenya's repeated 2017 elections; the 2016 Gambian elections, when President Adama Barrow had to be sworn in from Senegal; or the violent post-election conflict in Ivory Coast in 2010 and 2011.
Senegal is important for Africa because it provides an example of a country that can help shift the narrative of the continent as an "arc of instability.".
For example, while Sufi Islam is the dominant religious practice in Senegal, religious minorities have long been accepted and given the freedom to practice their religion.
But I am concerned by recent reports in Western media that portray the African continent as another sphere for the Saudi Arabia-Iran rivalry to play out by disseminating Sunni-Shi'i sectarianism in Senegal and Nigeria.
There are tensions between the minority Salafi and Shi'i movements. But it is inaccurate to suggest that West Africa has fallen victim to Gulf power politics and has no religious agency of its own.
So far Senegalese have pushed back against suggestions that the country is becoming more radicalised by promoting Sufi Islam as an Islam of peace. Despite the growth of minority Islamic movements, the majority of Senegalese are likely to adamantly remain proud Sufis.