AKORA KHATTAK, Pakistan — Several thousand people gathered Saturday near the Afghan border to mourn the death of Maulana Sami ul-Haq, 82, a leading Sunni cleric and “father of the Taliban” who was stabbed to death by unknown assailants.

Officials and religious leaders from across the ideological spectrum in Pakistan and Afghanistan joined students from the renowned seminary in Akora Khattak where Haq taught and mentored two generations of Afghan Islamist fighters.

A delegation of Afghan leaders came to pay their respects to Haq, whom the Kabul government had asked to help persuade Taliban insurgent leaders to begin negotiations for an end to the 17-year war.

Some Pakistani attendees from banned religious groups hid their faces behind turbans.

Haq’s mysterious slaying Friday was a shock to the nation, coming amid several days of nationwide violent protests by traditionally moderate Sunni groups in Pakistan enraged by the Supreme Court’s acquittal of a Christian woman convicted of blasphemy.

The packed funeral was a momentary pause in the nation’s divisive turmoil as well as a tribute to Haq’s multifaceted influence on the country.

He was a radical Islamist scholar — often called by the title of respect, maulana. But he was also a respected political leader and legislator, and a humanitarian who famously issued a religious fatwa condemning Islamist militants for attacking health workers distributing the polio vaccine.

“We are all shocked, but also happy, because our respected maulana has become a martyr at this late stage of life,” said one teenage seminary student named Ikram Abbasi, who traveled hours on a bus with a group of classmates to attend the service. “He is a great leader, and he is a martyr for Islam.”

In the capital, Islamabad, and other cities, calm returned Saturday after anti-blasphemy groups called off four days of massive street protests. Their leaders professed to be nonviolent lovers of the prophet Muhammad, but they exhorted angry crowds to block highways, set fires and throw stones. Some called for a military mutiny and the deaths of the justices who on Wednesday overturned the blasphemy conviction of Asia Bibi after she spent nine years in prison.

The Pakistani government paid a high price for achieving that calm, by conceding to most of the protesters’ demands after hours of negotiations Friday.

The signed deal, made public immediately, allowed the anti-blasphemy groups to appeal the Supreme Court ruling. It also agreed that Bibi, whom the protesters want dead, will not be allowed to leave the country.

While many Pakistanis expressed relief that relative calm had returned after days of unrest, the stunning capitulation drew widespread condemnation Saturday. Many critics called it a dangerous surrender to the forces of religious extremism and hatred against minorities, who are often targeted on trumped-up charges of blasphemy against Islam.

Bibi, 47, a peasant worker, was convicted after an argument with Muslim co-workers in a field. The high court ruled that the evidence against her was flimsy and contradictory, but it did not criticize or question the strict blasphemy laws or the mandatory death sentence for those convicted.

Faisal Siddiqi, a lawyer writing in the Dawn newspaper, said the court ruling had set the tone “for a much larger, existential issue facing the country: whether Pakistan is actually becoming a theocratic state in which vigilantism prevails,” or whether the ruling is a “watershed moment” that will allow the Muslim-majority country to move ahead as a “modern constitutional state.”

Many people had praised Pakistan’s new prime minister, Imran Khan, after he gave a stern warning to the protesters in a televised speech Wednesday.

Khan called their aggressive behavior and threats “deplorable,” said they were not acting “in service to Islam,” and asked them not to clash with the laws of a democratic state.

But by Saturday, with Khan away on a visit to China, critics expressed disappointment that his resolve had crumbled and said this would further embolden a radical religious movement that has drawn support from millions of mainstream Sunni Muslims.

Some warned that Bibi’s life is not safe in Pakistan, where people accused of blasphemy are often lynched. Her lawyer fled the country Saturday, saying he had received death threats. The justices who freed Bibi have had their lives threatened, so another high court panel that hears the protesters’ appeal may also feel in danger.

“The boundaries of hate have continued to expand in Pakistan without any pushback from the state or society,” Babar Sattar, a lawyer in Islamabad, wrote in the News International newspaper on Saturday. “Clerics see this verdict as the state interfering in their exclusive domain.”

Constable reported from Islamabad.