CAIRO — Angry protests over an anti-Islam film spread across the Muslim world Friday, with demonstrators scaling the walls of US embassies in Tunisia and Sudan and torching part of a German embassy. Amid the turmoil, Islamic militants waving black banners and shouting “God is great” stormed an international peacekeepers base in Egypt’s Sinai and battled troops, wounding four Colombians.

Egypt’s new Islamist president went on national TV and appealed to Muslims to not attack embassies, denouncing the violence earlier this week in Libya that killed four Americans, including the US ambassador. Mohammed Morsi’s first public move to restrain protesters after days of near silence appeared aimed at repairing strains with the United States over this week’s violence.

Throughout the region, security forces struggled to rein in protesters. Police in Cairo prevented stone-throwing demonstrators from nearing the US Embassy, firing tear gas and deploying armored vehicles in a fourth day of clashes in the Egyptian capital. At least three protesters were killed around the region.

The day of protests, which spread to around 20 countries, started small and mostly peacefully in countries such as Indonesia, Malaysia, India, Afghanistan and Pakistan. The most violent demonstrations took place in the Middle East. In many places, only a few hundred took to the streets, mostly ultraconservative Islamists — but the mood was often furious.

On Thursday, Pope Benedict XVI appealed for peace and reconciliation among religions Friday as violence over an anti-Islam movie spilled over into Lebanon within hours of his arrival in the tumultuous region.

The pope flew into Lebanon for a three-day visit despite the recent unrest — including civil war in Syria, a mob attack that killed the US ambassador and three other Americans in Libya, and a string of violent protests across the Middle East stemming from the film, produced in the United States, which insults Islam.

“I have come to Lebanon as a pilgrim of peace,” the 85-year-old pope said upon arrival in Beirut, speaking under a canopy at the airport on a sultry afternoon. “As a friend of God and as a friend of men.”

He denounced religious fundamentalism, calling it “a falsification of religion.”

The demonstrators came out after weekly Friday Muslim prayers, where many clerics in their mosque sermons urged congregations to defend their faith, denouncing the obscure movie produced in the United States that denigrated the Prophet Muhammad. It was a dramatic expansion of protests that began earlier this week and saw assaults on the US embassies in Egypt and Yemen and the storming of the US Consulate in Benghazi, Libya.

Several thousand battled with Tunisian security forces outside the US Embassy in Tunis. Protesters rained down stones on police firing volleys of tear gas and shooting into the air. Some protesters scaled the embassy wall and stood on top of it, planting the Islamist flag that has become a symbol of the wave of protests: A black banner with the Islamic profession of faith, “There is no god but Allah and Muhammad is his prophet.”

Police chased them off the wall and took the flag down. Two protesters were killed and 29 people were wounded, including police.

The heaviest violence came in Sudan, where a prominent sheik on state radio urged protesters to march on the German Embassy to protest alleged anti-Muslim graffiti on mosques in Berlin and then to the US Embassy to protest the film.

“America has long been an enemy to Islam and to Sudan,” Sheik Mohammed Jizouly said.

Soon after, several hundred Sudanese stormed into the German Embassy, setting part of an embassy building aflame along with trash bins and a parked car. Protesters danced and celebrated around the burning barrels as palls of black smoke billowed into the sky until police firing tear gas drove them out of the compound. Some then began to demonstrate outside the neighboring British Embassy, shouting slogans.

Several thousand then moved on the American Embassy, on the capital’s outskirts. They tried to storm the mission, clashing with Sudanese police, who opened fire on some who tried to scale the compound’s wall. It was not clear whether any protesters made it into the embassy grounds.

The police then launched giant volleys of tear gas to disperse the crowd, starting a stampede. Witnesses reported seeing three protesters motionless on the ground, apparently dead, though there was no immediate confirmation of deaths in the violence.

The attack on the peacekeepers base in Egypt’s Sinai Peninsula raised the dangerous prospect of armed Islamic militants exploiting the turmoil to carry out attacks on Western targets. The base near the border with Gaza and Israel houses some 1,500 members of the multinational force, including American troops.

Gunmen waving the black Islamist banner and shouting “God is great” stormed into the base, firing automatic weapons. They set fire to vehicles and battled with peacekeepers inside, said a senior official with the force, speaking on condition of anonymity because he was not authorized to talk to the press. Four Colombian peacekeepers were wounded and were evacuated to Israel.

The official said it appeared the attack was connected to the wider protests in the region. The lawless Sinai is home to a number of armed jihadi groups, some of whom launched an surprise attack on Egyptian troops in August, killing 16. In recent years, there have been several attacks on peacekeepers’ vehicles in the area, but not such a brazen attack on their base. The multinational force was deployed in Sinai under the 1979 peace accord between Egypt and Israel.

Ahead of the expected wave of protests on Friday — a traditional day for rallies in the Islamic world — US Secretary of State Hillary Rodham Clinton explicitly denounced the movie, aiming to pre-empt further turmoil at its embassies and consulates. The film, called “Innocence of Muslims,” ridicules the Prophet Muhammad, portraying him as a fraud, a womanizer and a child molester.

“The United States government had absolutely nothing to do with this video,” she said before a meeting with the foreign minister of Morocco at the State Department. “We absolutely reject its content and message.” She said the video was “disgusting and reprehensible.”

Egypt’s Morsi said his TV address that “it is required by our religion to protect our guests and their homes and places of work,” he said.

He called the killing of the American ambassador in Libya unacceptable in Islam. “To God, attacking a person is bigger than an attack on the Kaaba,” he said, referring to Islam’s holiest site in Mecca.

His speech came after President Obama spoke with Morsi by telephone. The Obama administration has been angered by Morsi’s slow response to the attack Tuesday night on the US Embassy in Cairo. He made little more than vague statements about it for days without an outright condemnation of the breach, in which police did nothing to stop protesters from climbing the embassy walls.

His silence reflected the heavy pressure that Morsi, a longtime figure from the Muslim Brotherhood, faces from Egypt’s powerful ultraconservative Islamists. They are using the film issue to boost their own political prominence while challenging Morsi’s religious credentials.

Leaders of Egypt’s Jihad group, a former militant organization, held a conference in the Egyptian city of Alexandria and said anyone involved in “defamation” of the prophet should be killed. They called on Morsi to cut relations with US

“I appeal to President Mohammed Morsi to cut our relations with those monkeys and pigs,” said Rifaei Taha, a leading member of the group.

Several hundred people, mainly ultraconservatives, protested in Cairo’s Tahrir Square after weekly Muslim Friday prayers and tore up an American flag, waving the Islamist flag. A firebrand ultraconservative Salafi cleric blasted the film in his sermon in Tahrir, saying Muslims must defend Islam and its prophet.

Many in the crowd then moved to join protesters who have been clashing for several days with police between Tahrir and the US Embassy. “With our soul, our blood, we will avenge you, our Prophet,” they chanted as police fired volleys of tear gas.

Elsewhere, one protester was killed in the northern Lebanese city of Tripoli in clashes with security forces, after a crowd of protesters set fire to a KFC and a Hardee’s restaurant. Protesters hurled stones and glass at police in a furious melee that left 25 people wounded, 18 of them police.

In east Jerusalem, Israeli police stopped a crowd of around 400 Palestinians from marching on the US consulate to protest the film. Demonstrators threw bottles and stones at police, who responded by firing stun grenades. Four protesters were arrested.

Security forces in Yemen shot live rounds in the air and fired tear gas at a crowd of around 2,000 protesters trying to march to the US Embassy in the capital, Sanaa. Though outnumbered by protesters, security forces were able to keep the crowd about a block away from the mission.

A day earlier, hundreds of protesters chanting “death to America” stormed the embassy compound in Sanaa and burned the American flag. Four protesters were killed and 38 people wounded in that incident when police tried to clear the crowd, the Interior Ministry said Friday. The embassy said no staff was harmed.

In Tripoli and Benghazi, civil society groups planned demonstrations to voice their opposition to violence and the killing of the US ambassador in Tuesday night’s attack on the US consulate. Worshippers during Friday prayers said that they will carry flowers and lay them in front of the ambassador’s house in Benghazi.

Hundreds of hardline Muslims held peaceful protests against the film throughout Pakistan, shouting slogans and carrying banners criticizing the US and those involved in the film. Police in Islamabad set up barricades and razor wire to prevent protesters from getting to the diplomatic enclave, where the US Embassy and many other foreign missions are located.

About 1,500 protest in the eastern city of Jalalabad, shouting “Death to America” and urge President Hamid Karzai to cut relations with the US