Tunisia is bracing itself for the second open and free elections since its revolution and the toppling of its dictator in January 2011. While the rest of the Arab spring countries – Egypt, Libya, Syria, Bahrain, and Yemen – have slid either into chaos and civil strife or back into the bleak and brutal era of military coups, Tunisia seems to have withstood the powerful storms raging around it and will elect a representative parliament on Sunday.

The country has adopted a modern democratic constitution that won the approval of 93% of its diverse political parties. It is the most progressive constitution in the Arab region, enshrining women’s rights, freedom of belief, conscience, and worship, and banning incitement to violence and religious excommunication.

Tunisia has set up an independent commission tasked with overseeing the elections and the presidential polls due to be held next week.

The country is not out of the woods yet, though. Libya at its southern border is in turmoil, with rampant anarchy, proliferating arms, and disintegrating state structures; Mali further down in the sub-Saharan desert is in the grip of terrorism. More menacing is the presence of a Gulf block determined to annihilate what remains of the Arab spring, via the power of petrodollars. Though Tunisia is fortunate enough to be geographically remote from this centre of counter-revolution, it is not entirely immune to its destructive effects.

Tunisia’s strongest asset may be its cohesive society. With no sectarian, ethnic, religious or tribal divides, political and ideological differences do not turn into societal divisions, as they do in Iraq, Syria or Lebanon. And with a modernisation process that dates back to the 19th century, the country’s population is largely urbanised and relatively well educated, with a broad middle class and a vibrant civil society.

If the armies of Egypt and Tunisia were widely celebrated as “guardians of the revolution” after the toppling of Hosni Mubarak and Zine el-Abidine Ben Ali, the roles each has played since could not have been more different. While the former proceeded to seize power and rule with an iron fist, the latter has quietly retreated to its barracks. This was not merely accidental, but stems from the radically divergent functions the two military institutions have exercised through their countries’ recent history.

Habib Bourguiba, Tunisia’s post-independence president, was highly suspicious of the army and anxious to prevent a repetition of the coups staged by Gamal Abdel Nasser in Egypt and the Ba’ath party in Syria and Iraq. Kept to its barracks, the Tunisian army’s role was, therefore, confined to protecting the country’s rather quiet borders, as far away from politics as possible. Bourguiba’s authoritarian rule rested on a mixture of national liberation legitimacy, personal charisma, and doses of police repression. The last of these was to deepen with Ben Ali’s rule, which turned Tunisia into a virtual police state.

Government in Tunisia was thus left to the politicians, free from the overbearing presence of military men. Without their omnipresent shadow, politics has been able to evolve spontaneously amid the post-revolution uncertainty.

While the Muslim Brotherhood in Egypt adopted a winner-takes-all approach after gaining a majority of votes in the elections, Tunisia’s Ennahda – a movement my father co-founded – sought to form wide political coalitions with other secular parties.

Winning the constituent assembly elections in 2011, it called for a national unity government, and proceeded to share power with two left- and liberal-leaning parties – the Congress for the Republic and the Democratic Forum – within what came to be known as the Troika. This commitment to consensus-building has shielded Tunisia from the intense ideological polarisation that has scarred Egyptian political life, paving the way for the return of the old guard.

And when Tunisia was plunged into crisis after the military coup in Egypt – which happened to coincide with the assassination of a member of the Tunisian opposition – Ennahda gave up power to a caretaker government in the run-up to the 2013 elections, much to its bases’ fury and discontent.

This awareness of the complexity of transition and the dangers presented by the region have spared the country much bloodshed, helping keep its nascent democracy on track.

Through their years of exile in European capitals, Ennahda’s leaders appear to have learned the art of compromise and consensus – the complex business of politics, with its painstaking negotiations, necessary concessions and changing coalitions and alliances.

Events in Tunisia are significant not only for its 11 million inhabitants, but for the wider region. The birth of this first fully fledged Arab democracy could offer a model of hope amid the feverish voices of despair and nihilism, and the backdrop of military dictators, corrupt theocrats and militant anarchists. Just as Tunisia showed Arabs the way out of the prison of dictatorship three years ago, today it is again demonstrating that on the ruins of the old order a democracy can be built, arduous as the road there may be.