ISLAMABAD, Pakistan — Pakistan’s government struck a deal on Monday with leaders of a fundamentalist Islamist protest movement, saying that the country’s law minister would step down in return for an end to demonstrations that had brought violent clashes and paralyzed the Pakistani capital for weeks.

The embattled law minister, Zahid Hamid, whom protesters had accused of blasphemy, resigned as part of negotiations overseen by Pakistan’s military, officials said.

Public anger over the protest’s disruption of Islamabad, the capital, had been growing by the day, and the agreement was widely seen as another in a string of capitulations by the government to religious extremists who command growing popularity in Pakistan.