ISLAMABAD, Pakistan — Pakistan averted a political showdown on Monday as officials reopened a key national highway that supporters of a militant Islamist group had occupied for days, following a secret pact between the government and the group.
The agreement defused a crisis that had left the country reeling in recent days, the latest in a series of debilitating standoffs with Islamist hard-liners protesting perceived blasphemy. But it also illustrated the growing influence and power of such groups, including Tehreek-e-Labaik Pakistan, or T.L.P., which Pakistan banned as a terrorist organization in April, and the weak civilian government’s struggle to assert itself amid economic troubles and rising inflation.
“Just because the government has reached an ‘agreement’ with the T.L.P., it does not mean that such public outcry against blasphemy will not raise its head again,” said Saad Rasool, a constitutional lawyer and newspaper columnist.
After a violent, dayslong face-off with members of T.L.P. that left four police officers dead, the Pakistani government announced Sunday that it had entered into an agreement with the group, but did not disclose the terms publicly. Many of the group’s supporters remained on the national highway, hoping to pressure the government to follow through on the promises made in the agreement.
The latest standoff began on Oct. 21, when thousands of supporters of T.L.P. began marching toward Islamabad from Lahore, 240 miles away. They demanded the release of the group’s leader, Saad Hussain Rizvi, who was arrested in April, and the withdrawal of terrorism charges against hundreds of its members.
The group also demanded the expulsion of the French ambassador over cartoons published in France that depicted the Prophet Muhammad. The government of Prime Minister Imran Khan had agreed to put the question of expulsion to a parliamentary vote last spring but did not follow through.
Violent clashes last week between protesters and the police left four officers dead and 114 other officers wounded, some critically.
After the police failed to stop the marchers — many of them armed — paramilitary troops were called in to quell the violence.
By Friday, the protesters were camped along a key national highway, a portion of the Grand Trunk Road that is roughly 100 miles south of Islamabad, where paramilitary troops cautioned them against advancing farther.
Mr. Khan’s government initially adopted a tough stance, with some cabinet ministers saying the protest would not be tolerated. The protesters paid little heed and vowed to press ahead.
The unrest paralyzed several cities in Punjab Province, as the authorities used shipping containers to barricade highways and blocked internet services. Businesses were shut down around the Grand Truck Road, one of the busiest national highways and an artery to several industrial cities. Supply lines were choked, officials said, affecting food relief campaigns to neighboring Afghanistan.
As fears grew of an escalation in violence over the weekend, hectic meetings took place between the government and T.L.P., brokered by senior religious figures.
On Sunday afternoon, Mufti Muneebur Rehman, an influential cleric who acted as a guarantor for T.L.P., and glum-looking cabinet ministers addressed a news conference in Islamabad to disclose the agreement.
“This is not a victory or defeat of any side,” Mr. Rehman said, adding that details of the agreement would be made public later.
As part of the pact, the terms of which were widely reported by local media, T.L.P. dropped its demand that Pakistan cut off diplomatic ties with France. In exchange, the government agreed to release members of the group who had been imprisoned and not bring new charges against the group’s leaders. It also agreed to lift its ban against the group.
Opposition leaders demanded more clarity.
Among them was Sherry Rehman of the Pakistan Peoples Party, who wrote on Twitter: “What is the agreement made and why will it be disclosed at ‘an appropriate time?’ Peace with the state on what terms?”
Arif Rafiq, president of Vizier Consulting, a political risk advisory company in New York, said that the protests in Pakistan over blasphemy go back as far as the 1970s and described T.L.P. as a problem for the government that it will not easily solve.
“There’s no overnight solution to the Labaik challenge,” he said. “It’s a niche group with strong grass-roots appeal in Pakistan’s major population centers. And it’s capable of leveraging that support both on the street and at the ballot box.”
Mr. Rasool, the constitutional lawyer, said, “The state of Pakistan, in partnership with moderate clerics, must find a concerted narrative of nonviolence against events of blasphemy.”
Sunni Muslims, especially of the Barelvi sect, who make up a majority of Pakistan’s population, view depictions of the Prophet Muhammad as blasphemous. Perceived insults have prompted angry protests and mob violence.
T.L.P. has channeled this anger within the Pakistani population and has emerged as a powerful force in recent years, with its ability to mount violent protests and rallies. The recent protest was at least its sixth major confrontation with the government.
The potency of the threat the T.L.P. poses is not lost on Pakistan’s civil and military leadership.
In a briefing late Friday at the country’s spy agency headquarters in Islamabad, senior security officials and cabinet ministers told a group of journalists, including The New York Times, that the state could not allow an armed group to challenge its rule. But they appeared fearful of a clash between the protesters and the paratroopers, who fall under the army’s chain of command.
Citing the potential for violence if armed troops confronted protesters, a senior intelligence official said such a crackdown would be imposed only as a last resort.