Lebanon's interior minister has quit after protesters sacked Beirut's Danish embassy in more ructions over cartoons depicting the prophet Muhammad.
"A few minutes ago I put my resignation at the disposal of the cabinet. I didn't wait for an answer and left the meeting," Mr Hassan Sabeh said.
Around 200 people were arrested after the riot, including more than 70 Syrians and some Palestinians.
The cartoons were first published in a Danish newspaper.
On Saturday, mobs in Syria torched the Danish and Norwegian embassies in Damascus.
Danish Foreign Minister Per Stig Moeller has called for calm.
"It is a critical situation and it is very serious," he told Danish public radio.
Danes living in Lebanon have been told to leave the country or stay indoors.
Mr Sabeh said 1,200 security men and 1,600 army troops had been called in to prevent peaceful protests turning violent on Sunday.
"But things got out of hand when elements that had infiltrated into the ranks of the demonstrators broke through security shields," Mr Sabeh said.
"The one remaining option was an order to shoot, but I was not prepared to order the troops to shoot Lebanese citizens," he added.
The violence has been condemned by political leaders across the country, says the BBC's correspondent Jim Muir.
Around 200 people have been arrested, including more than 70 Syrians and some Palestinians, as well as Lebanese.
Some leading politicians were quick to accuse Syria of instigating the violence in order to undermine Lebanese security, our correspondent says.
Thousands of protesters attacked the Danish mission in Beirut
Lebanon's leading Sunni politician Saad Hariri, said the violence was a "black day" for Lebanon's Muslims.
The cartoons first appeared in a Danish newspaper in September and caused outrage among Muslims, who consider any images of Muhammad offensive.
One of the cartoons shows Muhammad wearing a bomb-shaped turban.
Newspapers across Europe republished the pictures in recent days, saying they are defending freedom of expression.
'Respect our religion'
Huge crowds attended Sunday's protest in the Christian neighbourhood where the Danish embassy is located.
The protest started out peacefully, but turned violent after Islamic extremists tried to break though security barriers protecting the building.
"We have a right to defend our prophet," one protester told the BBC.
30 Sept 2005: Danish paper publishes cartoons
20 Oct: Muslim ambassadors complain to Danish PM
10 Jan 2006: Norwegian publication reprints cartoons
26 Jan: Saudi Arabia recalls its ambassador
30 Jan: Gunmen raid EU's Gaza office demanding apology
31 Jan: Danish paper apologises
1 Feb: Papers in France, Germany, Italy and Spain reprint cartoons
4 Feb: Syrians attack Danish and Norwegian embassies in Damascus
"They should have respected our religion," said another.
Some 2,000 riot police and army troops fired tear gas and water cannons to disperse the crowd and fired their weapons into the air.
But smoke was later seen rising from the building, which also houses commercial offices, after demonstrators broke into it.
The building was believed to be unoccupied at the time.
Some protesters threw stones at the security forces and burned Danish flags. A nearby church and other property in the neighbourhood were also attacked.
Muslim clerics had spoken out against the protests
Security officials said at least 18 people were injured, AP news agency reported. The government said several dozen Lebanese and Syrians had been arrested.