DUBAI, United Arab Emirates - Tens of thousands of Muslims, from Pakistan to Lebanon to the Palestinian territories, poured out of prayer services to join anti-France protests on Friday, as the French president's vow to protect the right to caricature the Prophet Muhammad continues to roil the Muslim world.

Hardline Islamic groups across the region have seized on the the French government's staunch secularist stance as an affront to Islam, rallying their supporters and stirring up rage.

Demonstrations in Pakistan's capital Islamabad turned violent as some 2,000 people who tried to march toward the French Embassy were pushed back by police firing tear gas and beating protesters with batons. Crowds of Islamist activists hanged an effigy of French President Emmanuel Macron from a highway overpass after pounding it furiously with their shoes. Several demonstrators were wounded in clashes with police as authorities pushed to evict activists from the area surrounding the embassy.

In Pakistan's eastern city of Lahore, an estimated 10,000 followers of the radical Islamic Tehreek-e-Labbaik party celebrating the Mawlid, the birthday of the Prophet Muhammad, took to the streets. They chanted anti-France slogans, raised banners and clogged major roads en route to a Sufi shrine.

“There's only one punishment for blasphemy,” bellowed Khadim Hussain Rizvi, a fiery cleric leading the march.

“Beheading! Beheading!” the protesters yelled back.

The demonstrations, largely led by Islamist parties across the region, come amid rising tensions between France and Muslim-majority nations, which flared up earlier this month when a young Muslim beheaded a French schoolteacher who had shown caricatures of the Prophet Muhammad in class.

The images, republished by the satirical magazine Charlie Hebdo to mark the opening of the trial for the deadly 2015 attack against the publication, have stirred the ire of Muslims across the world who consider depictions of the prophet blasphemous. On Thursday, a knife-wielding Tunisian man carrying a copy of the Qur'an killed three people at a church in the Mediterranean city of Nice.

A few hundred demonstrators in Lebanon's capital Beirut flocked toward the Palais des Pins, the official residence of the French ambassador to Lebanon, but found their way blocked by lines of police officers in riot gear. Waving black and white flags with Islamist insignia, the Sunni Islamist activists cried, “At your service, oh prophet of God.” Some slung stones at police who responded with smoke and tear gas.

The sight of anti-France protests in Lebanon is an embarrassment for Prime Minister-designate Saad Hariri, who is trying to form a new government that would implement a French plan for reform. France, Lebanon's former colonial ruler, has been helping the country chart a course out of its spiraling economic and financial crisis.

In Istanbul, Turkey's largest city, worshippers thronged a Shiite mosque after Friday prayers, chanting religious slogans and holding signs lampooning Macron. Turkey has led regional condemnation of the French president, with President Recep Tayyip Erdogan's verbal attacks on Macron prompting France to recall its ambassador to Turkey last weekend.

Hundreds of Palestinians also protested against Macron outside the Al-Aqsa Mosque in Jerusalem, the third holiest site in Islam, chanting, “With our souls and with our blood we sacrifice for our prophet, Muhammad.” Some youths scuffled with Israeli police as they exited the esplanade into the Old City. Israeli police said they dispersed the gathering and detained three people.

Scores more turned out in the Gaza Strip, where the militant Hamas group organized anti-France rallies at mosques across the territory that it controls.

Fathi Hammad, a Hamas official, addressed a demonstration at the Jabaliya refugee camp, vowing “to stand together to confront this criminal offensive that harms the faith of about two billion Muslims,” referring to depictions of the Muslim prophet. He reiterated Hamas authorities' appeal for Palestinians to boycott all French products.

One protester, who identified himself as Abu Huzayfa, equivocated when asked about recent attacks in France in retribution for the cartoons.

“We don't target innocents,” he said. “But those who directly insult our prophet will shoulder the responsibility.”

Cries of “Death to France” rang out in Afghanistan's capital of Kabul and several other provinces as thousands filled the streets. Demonstrators trampled on portraits of Macron and called on Afghan leaders to shut down the French embassy, halt French imports and ban French citizens from visiting the country. In the country's western Herat province, protesters hoisted an effigy of Macron on a crane and set it alight.

Gulbuddin Hekmatyar, the leader of Hezb-i-Islami, an Islamist party, warned Macron that if he doesn't “control the situation, we are going to a third world war and Europe will be responsible.”

Muslims also rallied outside the Middle East, with a huge crowd of some 50,000 noisily chanting protesters in Bangladesh's capital of Dhaka torching effigies of Macron and holding signs that read, “Say no to Islamophobia,” “Stop racism,” and “Boycott French products.” Several hundred protested peacefully in Ethiopia's capital after Friday prayers.

Over the past week, protests and calls to boycott French products have spread rapidly. Social media has been pulsing with anti-France hashtags. Muslim leaders have loudly criticized France for what they see as the government's provocative and anti-Muslim stance.

Thursday's attack in Nice also drew condemnations from leaders of countries that had voiced outrage over the caricatures, such as Saudi Arabia, Pakistan and Egypt.

In a Friday sermon aired live on Egyptian state TV, the country's minister of religious endowments appeared to denounce any violent retaliation for the cartoons.

“Love of the prophet cannot be expressed by killing, sabotaging or responding to evil with evil,” said Mohamed Mokhtar Gomaa, addressing dozens of worshippers at a mosque in Egypt's Delta province of Daqahleya.

Associated Press writers Asim Tanveer in Multan, Pakistan; Munir Ahmed in Islamabad, Pakistan; Tameem Akhgar in Kabul, Afghanistan; Noha ElHennawy in Cairo; Joseph Krauss in Jerusalem; Julhas Alam in Dhaka, Bangladesh; Elias Meseret in Addis Ababa, Ethiopia; Zeina Karam in Beirut; Robert Badendieck in Istanbul; Fares Akram in Gaza City, Gaza Strip, contributed to this report.