Tunisia's ruling Islamists have opted for a strategy of compromise on the thorniest aspects of the future constitution to save their political legacy, challenged by social unrest and elections this year, analysts say.
Unlike its Egyptian counterpart the Muslim Brotherhood, also elected after a popular uprising in 2011 but deposed by the army last year and outlawed, Ennahda has survived a succession of crises and is set to step down to ensure a peaceful transition.
Tunisia's Islamist party has pledged to relinquish power in the coming days, under a deal that aims to see an electoral commission formed and the draft charter ratified by January 14, the third anniversary of the revolution.
Since the scrutiny of the new constitution began last week, they have accepted a lesser role for Islam, and the principle of equal rights for women, while holding to their promise not to criminalise "attacks on the sacred".
Despite chaotic scenes in parliament, more than 40 articles out of around 150 have now been passed by a healthy majority, raising hope that two-thirds of the 217 elected members will approve the charter and avoid it being put to a referendum.
For independent political analyst Selim Kharrat, Ennahda chose consensus, more than two years after triumphing in parliamentary polls, to be able to hand over power with its head held high.
"The only concrete achievement that Ennahda can still hope for is the adoption of the constitution," he said, alluding to the struggling economy and the country's fragile security situation, given the presence of armed jihadist groups.
"They must also show the world that political Islam can be compatible with international democratic standards, especially if you look at what's going on in other Arab-Muslim countries."
Until now, the party has also managed to control its more radical elements and goad them into accepting difficult compromises.
Habib Ellouze, an Ennahda hardliner, was reprimanded after calling a leftwing politician an enemy of Islam, allegedly resulting in death threats against the opposition MP.
Faced with the outrage of secular opponents in the assembly, the Islamists agreed to a proposed amendment to the constitution making it illegal to accuse someone of apostasy.
Signup to our newsletter and follow us on Facebook and Twitter!
"There is a real effort by Ennahda to respect the compromise agreements reached with (the opposition), even though its elected members are far from unified," Kharrat said.
Sami Brahem, an expert on Islamic culture, argue that the Islamists were obliged to adapt to their more conservative positions to avoid alienating liberal Tunisians.
"You could say that Ennahda has shown itself to be a modern movement, but also that it didn't have a choice, because Tunisian society is modern and progressive," he said.
One eye on Egypt
According to Mourad Sellami, a political journalist with Tunisian daily Le Quotidien, Ennahda has been motivated by fears of a similar scenario to what happened in Egypt, where the army toppled the Muslim Brotherhood last July after days of mass protest.
Tunisia's latest political crisis erupted shortly afterwards, when the killing of opposition MP Mohamed Brahmi by suspected Islamist militants brought tens of thousands of demonstrators onto the streets to demand Ennahda's resignation.
"I think Ennahda has drawn lessons from the failure of the Brothers in Egypt. That's the reason it accepted freedom of conscience, concessions on the relationship between religion and the state," Sellami said.
Another key factor behind Ennahda's decision to hand power to a transitional technocrat government, the journalist argued, is the rise in social tensions linked to Tunisia's ongoing economic malaise, which the Islamists want to distance themselves from before the next elections.
Protests and strikes have multiplied, with unemployed youths demanding work, particularly in the country's impoverished interior, amid the prospect of unpopular taxes to fill the state's empty coffers.
"There are pitfalls everywhere. Ennahda's strategy of moderation also comes from a lack of alternatives. They know that the next government will have no magic wand, that they will still have the same problems, and they won't be able to say: 'You see, that wasn't our fault,'" Sellami said.
Whatever the constitutional compromises ratified in recent days, Kharrat says the real challenge will be inserting them into the penal code and civil law, which will be the responsibility of the next parliament.
"Whether Ennahda or the so-called democratic opposition win the elections, nothing today guarantees that the constitution will apply as it should."