Tunisian Prime Minister Hamadi Jebali resigned on Tuesday after failing to replace a government pulled apart by acrimony between his Islamist allies and their secular opponents.
Mr. Jebali had threatened to quit if his plan for a non-partisan cabinet of technocrats to lead the North African country into early elections foundered.
In the end it was his own party, Ennahda, that rejected the proposal, prolonging the political standoff that has cast a shadow over Tunisia's fledgling democracy and deepened an economic crisis.
"This is a big disappointment," Mr. Jebali said in announcing his resignation. "Our people are disillusioned by the political class. We must restore confidence." He added that he was convinced a non-political team "is the best way to save the country from wandering off track."
Tunisia's deepest political crisis since the 2011 Arab Spring uprising that toppled president Zine El Abidine Ben Ali began when leading secular opposition politician Chokri Belaid was gunned down outside his home in Tunis on Feb. 6.
No one claimed responsibility for the killing, but it deepened the misgivings of secularists, who believe Mr. Jebali's government has failed to deal firmly enough with religious extremists threatening the country's stability.
Protesters poured onto the streets in the following days and President Moncef Marzouki's secularist party threatened to quit the coalition government.
Mr. Jebali said then he would try to form a cabinet of apolitical technocrats to restore calm and take Tunisia to elections, but did not consult his Ennahda allies or their secular coalition partners before making the proposal.
Several secular politicians backed the plan but Ennahda, winner of most parliamentary seats in elections that followed Mr. Ben Ali's overthrow, opposed the idea, fearing it would be sidelined from power.
Mr. Jebali bet his own job on the outcome, saying he would quit if he was rebuffed, and lost.
He quits 15 months into the job, although political experts said Mr. Marzouki was likely to reappoint him as caretaker premier before a new leader is appointed.
Ennahda leader Rachid Ghannouchi has said he wants to see Mr. Jebali head a new coalition. President Marzouki was due to meet Ghannouchi on Wednesday to ask him to name a prime minister.
But Mr. Jebali, announcing his resignation late on Tuesday, said he would not lead another government without assurances on the timing of fresh elections and a new constitution.
No government would be viable without Ennahda's blessing given its strength in parliament.
Mr. Ghannouchi has said it is essential that Islamists and secular parties share power now and in the future, and that his party was willing to compromise over control of important ministries such as Foreign Affairs, Justice and Interior.
"Ennahda is in negotiations with political parties to form a national coalition government", said Fethi Ayadi, a senior Ennahda official.
Iyed Dahmani, a leader of the secular Republican Party, said some kind of agreement was vital.
"We are in real trouble, politically and economically," he said.
The crisis has disrupted efforts to revitalize an economy hit hard by the disorder that followed the overthrow of Mr. Ben Ali.
Tunisia has been negotiating with the International Monetary Fund for a $1.78-billion loan and politicians said Mr. Jebali's inability to re-establish a functioning government had slowed efforts to restore normality.
Credit rating service Standard and Poor's said on Tuesday it had lowered its long-term foreign and local currency sovereign credit rating on Tunisia, citing "a risk that the political situation could deteriorate further amid a worsening fiscal, external and economic outlook".