WASHINGTON/KHARTOUM - The United States ordered non-essential staff to leave its embassies in Tunisia and Sudan on Saturday after both diplomatic posts were attacked and Khartoum rejected a U.S. request to send a platoon of Marines to bolster security at its mission there.

"Given the security situation in Tunis and Khartoum, the U.S. State Department has ordered the departure of all family members and non-emergency personnel from both posts, and issued parallel travel warnings to American citizens," State Department spokeswoman Victoria Nuland said in a statement.

The U.S. embassies in Tunis and Khartoum were attacked on Friday by protesters infuriated by a widely disseminated anti-Islamic film, made in the United States, that insults the Prophet Mohammad and has provoked a violent reaction across the Muslim world.

Four people were killed and 46 injured in the assault on the U.S. Embassy in Tunis, according to a hospital official in the city.

In Khartoum, around 5,000 people protesting against the film stormed the German embassy before breaking into the U.S. mission on Friday. They also attacked the British embassy and at least two people were killed in clashes with police, according to state media.

A U.S. official told Reuters on Friday that Washington would send Marines to Sudan to improve security at the embassy, which is located outside Khartoum for security reasons.

But Sudanese Foreign Minister Ali Ahmed Karti told the state news agency SUNA, "Sudan is able to protect the diplomatic missions in Khartoum and the state is committed to protecting its guests in the diplomatic corps."

The top security body in the Khartoum region said that "the surveillance and protection of embassy, mission and foreign residential buildings has been stepped up to prevent any dangers," said the state-linked Sudanese Media Centre.

Sudanese and U.S. officials said on Saturday that the Marines had already set off for Khartoum but had been called back pending further discussions with Sudan.

The United States had "requested additional security precautions as a result of yesterday's damage to our embassy," said Nuland, the State Department spokeswoman. "We are continuing to monitor the situation closely to ensure we have what we need to protect our people and facility."

A riot police truck was parked in front of the deserted German embassy, which protesters had set on fire. But an Islamic flag raised by the crowd was still flying.

More than 20 police officers were sitting in front of the U.S. embassy.

Sudan has also criticised Germany for allowing a protest last month by right-wing activists carrying caricatures of Mohammad, and for Chancellor Angela Merkel's award in 2010 to a Danish cartoonist who had depicted the prophet, triggering unrest across the Islamic world.

President Omar Hassan al-Bashir has been under pressure from Islamists who feel the government has given up the religious values of his 1989 Islamist coup.

The Sudanese government had called for protests against the film, but peaceful ones. U.S. President Barack Obama's administration said it had nothing to do with the movie, which is little more than an amateurish video clip and appears to have been made in California.