The military coup in Egypt has starkly illustrated the failure of Islamist parties elected in the wake of the Arab Spring to adapt to the practicalities of power and respond to popular expectation, analysts say.
Egypt's Muslim Brotherhood and the closely connected Ennahda (Renaissance) party in Tunisia, which both shot to power in the 2011 uprisings that unseated long-standing dictators, were largely absent from the mass protests and therefore unable to take ownership of them, the experts say.
"The Islamists were surprised by the revolutions. They never thought that they would govern or would end up having to take charge of a state whose legacy is corruption and dictatorship," said Sami Brahmi, a Tunisian expert on Arab and Islamic civilisation.
"If any political party (in Egypt or Tunisia) is really ready to govern, to create the hallmarks of democracy, the Islamists most redouble their efforts to convince" people that they can, Brahmi said.
Since well before the massive protests that led to the Egyptian army's ouster of president Mohamed Morsi this week, the so-called modernists in both countries often proclaimed their sharp opposition to the Islamists, accusing them of seeking to establish an Islamic dictatorship.
"The refusal of president Mohamed Morsi to offer concessions that could have resulted in a less dramatic outcome makes the task of his adversaries much easier," said Ahmed Manai, president the Tunisian Institute for International Relations.
The work of the Islamist governments has also been complicated by the mistrust of the administrative elites, argues Michael Ayari with the think tank International Crisis Group.
"They took over in countries which each have a well-established state apparatus, a former administration in place that has been reluctant to serve these new people, because they feel threatened by them. They did not arrive by the same route, they do not share the same culture," Ayari said.
Signup to our newsletter and follow us on Facebook and Twitter!
So when the Muslim Brotherhood and Ennahda tried to purge the systems they inherited, in a more or less unilateral manner, it was perceived "as proof of their controlling tendencies," he added.
"In short, the Islamists have democratic legitimacy, but not the technocratic and revolutionary legitimacy."
But the experiences are not identical, and while Brothers in Egypt were less conciliatory, partly explaining the huge popular protests that finally drove them from power, Tunisia's rulers have been more open to dialogue.
Often against their will and always after lengthy debate, Ennahda has made key concessions, most notably in agreeing to omit Islamic sharia law from the new constitution, to not punish sacrilegious acts, and to recognise equal rights for women.
In taking such decisions "they set themselves in opposition to preachers from their own movement," Ayari said.
Not having an outright majority in Tunisia's National Assembly, Ennahda had to ally itself with two secular parties and negotiate with hostile opposition groups to draft the country's new constitution.
The unfinished project has already been heavily delayed and has stoked political tensions in Tunisia, but the situation there has never provoked confrontations of the kind witnessed in Egypt.
Tunisia's president Moncef Marzouki, who heads a secular party allied to Ennahda, said the "Egyptian scenario" would not be repeated in Tunisia because the army "has never got mixed up with politics" and because the political forces were trying to "live together in dialogue" despite their differences.
But he also stressed that the new regimes needed to respond to the "serious" demands of the people, referring to the poor living conditions that were a driving factor behind the uprisings in both Tunisia and Egypt.
"We must understand this signal (from Egypt), pay attention, realise that there are serious economic and social demands."