Tunisia's political uncertainty continued on Tuesday after the moderate Islamist prime minister resigned, having failed to appoint a technocratic, caretaker government to end the long-running political crisis.

The political stalemate prompted an international ratings agency to downgrade Tunisia's credit rating, putting further strain on its struggling economy.

Hamadi Jebali, from the moderate Islamist Ennahda party, stepped down after failing to push through his plan for a technocrat, non-political caretaker government to get Tunisia out of its political deadlock.

His move to step aside, which some had expected, is the latest twist in Tunisia's drawn-out political wrangling over the cabinet. Tensions deepened this month after the assassination of a leftist opposition figure, Chokri Belaid, shot dead outside his house in the first political murder of its kind for more than 50 years.

The political manoeuvring has exasperated voters and it remains to be seen whether Jebali's resignation will now kickstart political talks, or whether he could even stage a return. He insisted he would not lead another government without assurances on a date being set for fresh elections and a new constitution.

Jebali said: "Our people are disillusioned by the political class. We must restore confidence." He added that his resignation "does not mean the failure of Tunisia or the failure of the revolution", but warned the cabinet to do the "utmost to ensure that the state continues to function".

Tunisia overthrew Zine al-Abidine Ben Ali in a people's revolution in January 2011, which sparked the Arab Spring. It held its first free and democratic elections 10 months later and was seen as the poster child for comparatively smooth democratic transition in the region, while Egypt and Libya faced turmoil.

The moderate Islamist party, Ennahda, won the elections and went into a coalition government with two secular, centre-left parties as junior partners. The idea was that the government would sit for a year and agree on a new constitution and fresh elections.

But the year's deadline has passed, the coalition government has bickered and struggled to govern, and there is disappointment on the street at the lack of change in country of 10 million still battling with high unemployment, a big poverty gap and the corruption that sparked the unrest in 2011.

The Belaid assassination this month, which sparked rioting and profoundly shocked the country, brought the political deadlock to a head. After the killing, Jebali offered to dissolve the fractious coalition and put together a temporary new government of technocrats to smooth over the cracks until they could fix a date for elections.

The opposition welcomed the move. But a majority in Jebali's Ennahda party rejected it, saying the party had not been consulted. Tensions appeared within the party as its leadership organised two street demonstrations in which protesters and leading figures called for politicians to stay in charge of the government. Despite being overruled by his party, Jebali still holds the number two party post of secretary general.

After his resignation, there will be political talks on Wednesday aimed at appointing a prime minister and a cabinet.

Ennahda's leader, Rachid Ghannouchi, had put forward his own proposal on Monday for a mixed government of politicians and technocrats, and had said there was a consensus among political parties for Jebali to remain prime minister.

Jebali did not rule out accepting if he was asked by the president once more to form a new government, but he said that any new cabinet he would lead must be free from partisan haggling, inclusive of all political forces, and charged primarily with holding new elections.

Jebali's resignation came on the same day that international ratings agency Standard & Poor's downgraded the Tunisian government's credit rating over political instability, a blow to the North African nation's already struggling economy.

The economy, which relies heavily on exports to Europe as well as tourism, has been battered by unrest in the country and badly hit by financial crises facing many of its European trading partners.

Unemployment is at around 18% and the people have been stung by a 10% inflation rate. Tunisia's economy contracted by 1.8% in 2011 and saw a sluggish 2.4% growth in 2012. S&P said the current instability suggests that growth will not recover in 2013 either.

"We expect lower tourism receipts, combined with a widening trade deficit, to result in current account deficits that will remain in excess of 5% of GDP through 2016," the ratings agency's statement said. "We anticipate that Tunisia's economic recovery will be slow, particularly given the weak economic conditions in the EU."

The agency, which downgraded Tunisia's rating from BB to BB-, said recovery and investor confidence had been damaged by the pervasive instability as political parties have haggled over the shape of the government.

The move, the third such downgrade since the revolution, makes it harder for Tunisia to borrow on international markets and decreases foreign confidence in Tunisia's economy.