The shooting of a left-wing politician at the start of this month has plunged Tunisia - hitherto apparently the calmest of the post-Arab Spring countries - into political chaos.
There have been demonstrations blaming Ennahda, the largest Islamist party, for the killing (in that it allowed the security environment to deteriorate) and calls for a government free of their influence. The former prime minister, Hamadi Jebali, a leading member of Ennahda, tried to form a government of technocrats, in what appeared to be a political battle within the party.
Mr Jebali failed; over the weekend he conceded defeat and resigned. But his loss must not be Tunisia's failure. How leaders respond to his departure, and look to restore public confidence in government, will have profound implications for the future stability of Tunisia.
Ennahda refused to accept Mr Jebali's argument that the best way forward for the country was to create a government of technocrats - the party, as the largest in the constituent assembly, argued that they had a democratic mandate to continue. That is true, but only to a degree. As much as they have enormous support within the country, it is also clear that vast numbers of Tunisians have no faith in the party.
If the thousands who took to the streets since the assassination of Chokri Belaid did not convince Ennahda of that, then the political opposition's backing of Mr Jebali ought to have done so. Even if Ennahda believe their opponents are playing politics, they cannot be blind to real rifts within the country.
Mr Jebali's replacement is the interior minister Ali Larayedh, who will now attempt to form a new government. The appointment of Mr Larayedh may have been intended to send a signal that the party recognises security is essential (although his record as interior minister is mixed, at best), but more important than that will be the composition of his government. If he, and the party, are savvy, they will attempt to form a government that has sufficient technocratic experience to adhere to at least the spirit of Mr Jebali's propositions, even if maintaining the political line of Ennahda.
That would be wise, because Tunisians need to feel their largest political party is listening and governing in the interests of all, not merely of its supporters. Offering some concessions in the forming of the new government would do that, and go a long way towards regaining some of the confidence of Tunisians.