BEIRUT — Anti-French protests erupted in majority-Muslim countries on Friday, with tens of thousands expressing anger over the French government's call for "reform" of Islam.

The protests in the Middle East and South Asia were the latest sign of rising dismay directed at France and the government of President Emmanuel Macron, which has defended cartoons published by Charlie Hebdo, a satirical newspaper, which denigrated the prophet Muhammad. On Thursday, three people were killed in a French church in what Macron termed “an Islamist terrorist attack.”

In Bangladesh’s capital Dhaka, police said 20,000 protesters took to the streets after Friday prayers, rallying under the banner of two Islamist groups. The demonstrators carried signs reading: “Stop Religious Defamation,” “Freedom of Speech is not Freedom to Abuse” and “Boycott French Products.” The protesters burned an effigy of Macron, but the demonstration ultimately ended peacefully.

In the southern city of Chittagong, a protest of nearly 5,000 was organized by Hefazat-e-Islam, a hard-line Islamist group. The group’s spokesman, Azizul Islam, demanded that “Bangladesh and other Muslim countries end their diplomatic relationship with France and boycott French products.”

Several religious parties called for demonstrations across Pakistan following Friday prayers. In Islamabad, hundreds of people marched toward the French Embassy in a highly secured part of the city, and some protesters, chanting “God is great,” tried to remove barriers around the enclaves’ s perimeter.

Police responded with tear gas, and protesters hurled stones at the security forces. The clashes lasted for more than an hour.

France has been stunned by several deadly knife attacks carried out by Muslim assailants in several cities. But the response to the violence by the French authorities, which included a crackdown on Islamist groups, has energized parts of the Arab and Muslim world like few issues in recent memory.

The tensions intensified two weeks ago, after a suburban Paris teacher was beheaded for showing the cartoons of Muhammad in class. The assailant, who was fatally shot by police, was identified as an 18-year-old Moscow-born immigrant of Chechen descent.

Anti-French protests have taken place in Bahrain, and stores in Kuwait and Qatar have removed French products from shelves. Macron’s portrait has been burned or trampled in Turkey and Libya.

Turkey’s government has led the calls to boycott French products, while several other majority-Muslim states, including Saudi Arabia, Iran and Egypt, have issued statements expressing regret or condemnation over the continued promotion of the cartoons.

In the Gaza Strip, the governing militant group Hamas organized protests at several locations throughout the coastal enclave. In the city of Khan Younis, hundreds of men and some families gathered after Friday prayers. Many trampled posters of Macron, a sharp insult in Arab cultures, and some carried posters of the French president stamped with a boot print. Men sat in socially distant chairs, holding protests signs and chanting anti-French slogans.

Following a cleric’s call for a “day of rage” directed at France, Palestinian protesters gathered in East Jerusalem and several cities in the West Bank, including Ramallah. A crowd of more than a thousand amassed in East Jerusalem outside of the al-Aqsa Mosque, Islam’s third holiest site and a frequent location of clashes between Palestinians and Israeli security forces. There were no early reports of violence.

In Lebanon, a country that enjoys friendly relations with France, its former colonial ruler, a dozen buses sporting black and white flags headed on Friday to Beirut to join others in a planned anti-French protest. Early Friday, Lebanon’s internal security force announced road closures and security blocks around the French Embassy and Pine Residence, the official residence of the French ambassador, to thwart the gathering.

“Our leader forever, our master Muhammad,” men bellowed and chanted on a highway near the French Embassy, their road blocked by barbed wire and rows of riot police. Flags, both white and black, waved in the wind emblazoned with the words, “There is no god but Allah.” Men sported head bands that read the same.

“Man, these attacks on religion are not right,” said a 35-year-old protester from Tripoli. “Freedom of expression does not mean we should insult prophets and messengers.” He declined to give his name because of a common regional wariness of being quoted in the press.

Another man, who appeared to be leading the protest, yelled, “Muslims and non-Muslims refuse attacks on the prophet Muhammad . . . and on Islam.

“Those who do not stand by what is right and who stand by France . . . do not represent us. They do not speak for us. For France is colonial, an infidel, a traitor!” he shouted. Applause followed. Not long after, protesters began throwing metal pipes and chunks of concrete at the security forces, standing mere meters away.

Thursday marked the prophet Muhammad’s birthday, a day celebrated by many Muslims across the world as one of love and peace. The attacks were condemned by many on the holy day, with Muslim politicians and leaders emphasizing that such brutality flies in the face of the prophet’s message of peace; others, however, were further inflamed, angered at the resurrection of the insulting cartoons. Added to the insult is that photographic depictions of any prophet are prohibited in Islam.

On Thursday, French Foreign Minister Jean Yves Le Drian sent a “message of peace” to the Muslim world. “France is not the country of contempt. It’s the country of tolerance,” he said, speaking in the French Parliament. “The Muslim religion and culture are part of our history, French and European.”

Following Friday’s protests, Le Drian said he had dispatched an emergency message the night before to all French nationals abroad and that the country’s ambassadors have been instructed to take extra precautions “so that they reinforce security systems” around French embassies and cultural sites worldwide.

“We are moving quickly from virtual hatred to real violence, and we have decided to take all measures to ensure the security of our interests, of our nationals,” Le Drian said.

Fahim reported from Istanbul. Hazem Balousha in the Gaza Strip, Steve Hendrix in Jerusalem, Azad Majumder in Dhaka, James McAuley in Paris, Shaiq Hussain in Islamabad and Sufian Taha in Jerusalem contributed to this report.