CAIRO – From Tunis to Cairo to Jakarta, Indonesia, the Muslim world erupted in protests aimed at the United States on Friday as anger over a small-time movie that mocks the prophet Muhammad boiled over into assaults on embassies or demonstrations in nearly two dozen countries.

As governments struggled to contain a wave of fury in which U.S. embassy compounds in Sudan and Tunisia were broken into and others were targeted, the violence appeared to overwhelm whatever goodwill was built up during the Arab Spring, when the United States tried to support many countries’ efforts toward democracy and freedom.

On Friday, it was the freedom to target American-linked buildings that most defined the day, as many governments appeared to be taken by surprise at the strength of the protests. Not even KFC and Hardee’s were safe, with franchises in Tripoli, Lebanon, torched by protesters as security forces opened fire on them, killing at least one person.

It was impossible to know how many of the thousands of demonstrators who filled streets outside U.S. outposts were motivated by reports about the movie — which was made under mysterious circumstances, apparently by individuals in California — and how many were venting anger at the United States for other reasons. A short clip of the film has been available on the Internet for weeks, but apparently did not generate much attention until it was subtitled in Arabic and sent to Egyptian journalists.

But the vehemence and volatile nature of the protests in capital after capital — images of which were broadcast around the globe almost instantly via blogs, social media networks and cable news stations — were unmistakable.

Anti-U.S. demonstrations spread to Afghanistan, Bahrain, Bangladesh, Britain, East Jerusalem, Egypt, India, Indonesia, Iran, Iraq, Malaysia, Pakistan, Qatar, Syria, Turkey, the West Bank and Yemen, according to U.S. officials and news reports, with many protesters chanting religious slogans and railing against the denigration of Islam in the obscure low-budget film.

In Tunisia, whose toppling of an autocrat in 2011 set the Arab Spring in motion, an American school was largely destroyed in Tunis, the capital, and protesters set fire to cars inside the U.S. Embassy parking lot. U.S. officials said Tunisian security provided a “very strong presence,” confronting stone-throwing crowds with tear gas and gunfire and pushing demonstrators out of the embassy compound.

In Khartoum, the Sudanese capital, buses full of protesters stormed the German Embassy and set it ablaze, then headed for the U.S. Embassy on the outskirts of the city. Thousands gathered there, and many were trying to climb the embassy walls when police opened fire. At least three protesters were seen motionless on the ground, according to the Associated Press.

In Washington, the White House acknowledged that it had sought to discourage distribution of the video that sparked the protests, but insisted that it had made no formal request to the video-sharing Web site YouTube, which is owned by Google. Tommy Vietor, the National Security Council spokesman, said the White House had asked YouTube “to review whether it violates their terms of use.” Google said this week that it had blocked access to the video in Egypt and Libya.

President Obama made formal a previously announced decision to dispatch Marine quick-response teams to Libya and Yemen. In a letter to the House and Senate, Obama said that the security forces from the U.S. Africa Command “are equipped for combat,” although their purpose is solely to protect American citizens and property. Officials said plans are in motion to send a third team to Sudan, but that they are awaiting agreement from that government, with which U.S. relations are strained.

Obama later joined Secretary of State Hillary Rodham Clinton as the bodies of four Americans killed in Tuesday’s attack on the U.S. Consulate in Benghazi, Libya, arrived from Germany to land at Joint Base Andrews in Maryland aboard a military plane. The flag-draped transfer cases, including that of Ambassador J. Christopher Stevens, were carried solemnly to waiting hearses by Marines.

U.S. intelligence officials said they have tentatively concluded that the Libya assault was carried out by a group aligned with al-Qaida, but was not directed by the terrorist network’s core leadership. Still unable to reach the charred Benghazi compound, the officials have relied on intelligence from an array of sources, including news footage, intercepted phone calls and e-mails, and information from human sources recruited by the CIA, officials said.

Although the State Department initially provided sketchy details of the assault, spokeswoman Victoria Nuland said Friday that the consulate was now a “crime scene” under investigation by the FBI and no further information was available.

The White House has been in crisis mode since the Libya attack, with Deputy National Security Adviser Denis R. McDonough chairing twice-daily meetings of deputies from across the government as well as regular sessions of Obama’s top national security officials.

Maine Sen. Susan Collins, ranking Republican member of the Senate Homeland Security and Governmental Affairs Committee, said Friday that she found the lack of security at the Benghazi consulate “deeply troubling and inexplicable given the dangerous threat environment in that city.” Collins has participated in several classified briefings on the attacks.

“Earlier attempts in June to reportedly attack the British ambassador and to plant a bomb outside of our consulate clearly demonstrated how dangerous and unsettled Benghazi is,” Collins said in a statement. “Surely, the State Department should not have relied on Libyan nationals to guard the consulate. Rather, armed U.S. Marines should have been assigned to provide security.”

Administration officials expressed relief late Friday that the day’s damage had not been worse and credited their own outreach to Muslim leaders for limiting it. Obama, Clinton and other senior officials have contacted governments in affected countries to take stands against the violence and remind them they were responsible for protecting American personnel and installations.

Overnight Thursday, Obama sent a personal message to Turkish Prime Minister Recep Tayyip Erdogan asking him to speak out. In a speech Friday that a senior administration official described as “really strong,” Erdogan said that “both the mentality and the organization behind this movie and those perpetrating terrorist actions exploiting Islamic symbols and discourse” were equally to be condemned.

Vice President Joe Biden telephoned Sudanese Vice President Ali Osman Taha, and Clinton spoke Thursday with Afghan President Hamid Karzai.

Obama’s most crucial call, administration officials said, was late Wednesday to Egyptian President Mohamed Morsi, chiding him for failing to condemn the initial assault on the Cairo embassy even as his Muslim Brotherhood organization called for further protests against the film.

Morsi appeared to have been jolted into trying to tamp down public anger toward the United States and to fortify defenses around the embassy ahead of the protests Friday, which has traditionally been the biggest day for demonstrations in the Muslim world.

But Morsi finds himself in a difficult position as the first democratically elected leader of a country where many people are anti-American, even as he wishes to preserve good relations with the U.S. government, which sends Egypt $1.6 billion a year in aid. That dilemma was underscored Friday, when the Muslim Brotherhood again appeared to try to deliver two different messages: one in English to foreign audiences, saying in a posting on Twitter that it had canceled nationwide protests, and another statement in Arabic to its political base, calling for protests in front of mosques around the country. 

— MaineToday Media Washington, D.C., Bureau Chief Kevin Miller contributed to this story.