Tunisia, the birthplace of Arab Spring, is providing an alternative to confronting the rule of the Islamists than that of Egypt. The two countries offer important contrasts and parallels over the course that was taken in the aftermath of the peaceful unseating of two authoritarian rulers: Zine Al Abidine Bin Ali in Tunisia and Hosni Mubarak in Egypt. The two countries still hold hope for achieving the goals of the Arab Spring such as democracy, social and economic justice and political pluralism.

Post uprising elections in Tunisia and Egypt brought the Muslim Brotherhood to power for the first time. The two countries charted their own course towards democratic transition — electing a president and a national assembly and, in the case of Egypt, writing a new constitution. But soon public resentment of Islamist rule emerged. Worsening economic conditions and fear of attempts to impose a religious state, as part of a grand design by the international Muslim Brotherhood movement, created internal fissures and led to the breakout of violence amid political turmoil.

But the similarities end here. In Egypt, bitterness and anger over the authoritarian rule of president Mohammad Mursi forced millions to take to the streets on June 30. Three days later, the army stepped in and deposed Mursi, triggering a chain reaction of protests and violence. The military proposed a political roadmap and a transitional phase that includes amending the constitution, holding fresh legislative elections and electing a new president. Followers of the Muslim Brotherhood staged a month-long sit-in that was violently dispersed. Top Muslim Brotherhood leadership was rounded up and courts ordered the disbanding of the 85-year-old movement. The government backed military was bent on eradicating the movement from public life. Last week, a court recommended that the movement’s political arm, the Freedom and Justice Party, be dissolved.

Since the July 3 coup, Islamists have continued to stage protests, calling for the restoration of the “legitimate” president. In many cases, violence erupted and people were killed. The sacking of Mursi coincided with the outbreak of violence and terror in northern Sinai, forcing the army to launch the biggest military operation in the peninsula since the 1973 war with Israel. The crackdown on Muslim Brotherhood has polarised Egyptian society. Although weakened as a result of government onslaught, its followers continue to challenge the military. Last Sunday, when Egyptians were supposed to show unity as they celebrated the 40th anniversary of the October 6, 1973, victory over Israel, thousands of Islamists marched to protest the military takeover. By the end of the day, more than 50 were killed. A day later, a series of attacks on soldiers and government offices left scores dead. More than three months since the coup, Egypt remains gripped by crisis and violence.

Tunisians offered a different path in dealing with the unpopular rule of the Islamist-led government. The ruling coalition led by Al Nahda Party had rejected calls to resign and hold snap elections. The political crisis deepened following the assassination of two leading opposition members. But unlike their Egyptian counterpart, Tunisia’s Islamists expressed readiness to engage in a national dialogue. The events in Egypt had cast a shadow on Tunisian politics.

Eventually, the Islamist leadership in Tunisia bowed to public pressure and accepted the mediation of the country’s powerful labour union. After only a day of talks, a deal was reached under which the ruling coalition would resign to be replaced by a government of independents. The roadmap would also pave the way for drafting a new constitution to be followed by elections. While this process is still nascent — national dialogue will commence soon — it has circumscribed the deepening of a political crisis. It has also spared the country further violence, at least for now.

Despite many similarities between the Egyptian and Tunisian cases, the contrasts are clear. Tunisia has a long history of secular rule and the influence of the Islamists is largely limited to rural regions, while the left-leaning opposition is active especially in urban areas. The labour union is strong and well-organised and Tunisia has a vibrant westernised middle class. Al Nahda’s leader, Rashid Gannouchi, has lived in exile in Europe for years and is known for his libertarian ideas on controversial issues. And unlike Egypt, the military has no role in Tunisian politics.

The recent deal means that the Islamists will continue to be part of Tunisian politics. They appear to have learned from the Egyptian experience and are now willing to offer compromises. It will be interesting to see the outcome of the current process. Tunisia’s experiment may provide a much-needed vision of the role of political Islam in modern Arab societies.

Egypt has chosen a course that aims at extricating the Muslim Brotherhood from public life. That will prove to be an impossible task. The Muslim Brotherhood has endured since the 1930s and previous attempts to crush them. They have lost ground among followers and sympathisers as a result of Mursi’s uncompromising style and lack of experience. But one cannot write them off entirely. While Egypt appears to be trapped in a political vicious circle, Tunisians have opted for a more realistic path that avoids confrontation and chaos. They may still be on their way to achieve the lofty goals of the Arab Spring.

Osama Al Sharif is a journalist and political commentator based in Amman.