US missions are on high alert across the Muslim world as anger grows over a film made in the US that mocks Islam.
More anti-American demonstrations are expected after prayers on Friday. In the Egyptian capital, Cairo, police have fired tear gas at about 500 protesters near the US embassy.
On Tuesday, protesters stormed the US consulate in Benghazi in Libya, killing the ambassador and three others.
Since then unrest has spread across the Middle East and North Africa.
Protesters in Cairo were pushed back from the US embassy to Tahrir Square, where they are continuing to clash with police.
The streets around the embassy have been blocked with barbed wire, concrete and police trucks.
Islamist groups and others have called for a peaceful "million-man march" in the city later on Friday.
US President Barack Obama has promised to do whatever is necessary to protect US citizens abroad and has urged foreign governments to guarantee their security.
A bulletin issued by the FBI and the US Department of Homeland Security warned "the risk of violence could increase both at home and abroad as the film continues to gain attention".
UN Secretary-General Ban Ki-moon condemned the film, and the violence.
"Nothing justifies such killings and attacks," he said in a statement.
"The hateful film appears to have been deliberately designed to sow bigotry and bloodshed."
Libya's new Prime Minister Mustafa Abu Shaqur has told the BBC he does not want the consulate attack to damage relations with the US.
In Benghazi, US and Libyan officials are investigating the possibility that heavily armed militants used the protest as a pretext for a co-ordinated assault.
Libyan officials say several people have been arrested and are being interrogated on suspicion of having instigated the attack. Four embassy staff died, including Ambassador Chris Stevens.
Mr Shaqur blamed the attack on "criminals" and said anger against the film could not justify the violence.
"The people, they don't understand that such a case like this, the American government has nothing to do with it," he told the BBC.
"Somebody made a film and they put it on YouTube. It was very offensive for sure but that doesn't justify taking this wild actions against Americans or American embassies. People can come out and demonstrate and express their opinion peacefully."
Libyan Deputy Interior Minister Wanis al-Sharif told reporters that those arrested had been taken from their homes on Thursday but gave no further details.
No group has said it carried out the attack and Mr Sharif said it was too early to say if those arrested belonged to a particular organisation.
The film was shot in the US and clips translated into Arabic were posted online earlier this year. It depicts the Prophet Muhammad as a womaniser and the bloodthirsty leader of a ragtag group of men who enjoy killing.
However, the film's exact origin and the motivation behind its production remain a mystery.
Some of the actors involved have since condemned the film, saying they had no idea it was to be used as anti-Islam propaganda.