Tunisia's prime minister Mohammed Ghannouchi resigned Sunday and was replaced by Beji Caid Essebsi, a former minister, after anti-government protests left five people dead over the weekend.
Security forces again clashed with protesters in Tunis demanding the removal of some ministers of Ghannouchi's interim government before the premier announced his resignation.
"The acts of violence and looting, the unrest and the fires on Habib Bourguiba avenue in Tunis on Saturday have left five people dead," said an interior ministry statement quoted by TAP news agency.
"These human losses happened during the clashes" with "interior security forces which tried to push back a group of young people armed with knives and stones that tried to storm the interior ministry headquarters."
The statement also said 16 security officers were wounded when stones and other objects were hurled at them.
An investigation is under way to shed light on the circumstances of the deaths and injuries, it added.
The ministry said the "acts committed by these agitators, who do not want Tunisia to be stable... (were) serious."
Ghannouchi earlier said he decided to quit after just over six weeks as interim prime minister prior to elections expected by mid-July but was "not running away from responsibility".
"I am not ready to be the person who takes decisions that would end up causing casualties," Ghannouchi said.
"This resignation will serve Tunisia, and the revolution and the future of Tunisia," he added.
Interim President Foued Mebazaa appointed Caid Essebsi, 84, to succeed the 69-year-old Ghannouchi.
"I proposed Beji Caid Essebsi for the position of prime minister, and he has accepted the responsibility," said Mebazaa in a statement sent to local media.
Caid Essebsi "is known for his patriotism, his faithfulness and his self-sacrifice for the benefit of the fatherland," said the president.
He thanked Ghannouchi for serving Tunisia in difficult times after hardline president Zine El Abidine Ben Ali fled the country to Saudi Arabia in mid-January after 23 years in power.
Considered a liberal, Caid Essebsi held several ministerial posts under Ben Ali's predecessor Habib Bourguiba who had led Tunisia to independence from France. He was defence and foreign minister and speaker of parliament.
The leader of the influential UGTT trade union, Ali Ben Romdhane, welcomed Ghannouchi's resignation, saying his government had been hesitant and "unable to stop the violence".
But Ben Romdhane criticised the rapid nomination without consultations of a successor which he said had taken his movement by surprise.
How can Tunisia overcome its crisis "if the president does not take at least 24 hours for consultations", he asked.
Left-wing opposition leader Hamma Hammami told AFP: "We are expecting the formation of a new transition government, breaking totally with the old regime, which will follow an understanding between all the country's political forces."
The EU's foreign policy chief Catherin Ashton said she commended Ghannouchi's decision to resign as showing a "sense of responsibility, so as to avoid further violence.
"I hope that his decision will prevent any further tension and will allow the present transition phase to proceed in a peaceful and stable way."
She said in a statement she was "also encouraged that elections will take place before mid-July.
"It is important that a democratically elected government emerges from these elections to address the political, economic and social challenges faced by the country.
"The transitional government must ensure a rapid and smooth transition. The objective is a lasting transformation that delivers deep democracy and full respect for human rights and fundamental freedoms."
On Sunday police fired tear gas and warning shots on the capital's central Habib Bourguiba avenue to disperse stone-throwing youths on a third day of violence.
Security forces acted to stop protesters, who were chanting anti-government slogans, from reaching the interior ministry, AFP reporters said.
Rampaging youths hurled rocks at buildings to break the windows and threw up barricades to impede the police who were not able to disperse them.
In the protests demonstrators demanded the removal from the interim government of members of Ben Ali's regime, whose toppling on January 14 after weeks of demonstrations sparked similar uprisings across the Arab world.
More than 100 people were arrested for involvement in the unrest on Saturday and 88 people after a demonstration Friday, the ministry said, blaming the violence on "agitators" it said had infiltrated peaceful demonstrators.
A few hundred people assembled late Sunday in front of Ghannouchi's suburban home to express support for him, witnesses said.