Islamabad - Pakistaninfo-icon's federal law minister has resigned, acceding to a key demand made by thousands of protesters who have blocked a major highway into the Pakistani capital for weeks, the state radioinfo-icon broadcaster reports.

An agreement has been signed that would see the demonstrators in Islamabad and in other cities disperse, Interior Minister Ahsan Iqbal told the Islamabad High Courtinfo-icon during a hearing on Monday, ending a weeks-long standoff that threatened to escalate into countrywide violence.

"On the assurance of the Chief of Armyinfo-icon Staff, we are calling off the sit-in," cleric Khadim Hussain Rizvi told a crowd of around 2,500 demonstrators in Islamabad on Monday, the AFP news agency reported.

The agreement would also see all protesters who were arrested during the course of the sit-in, which began on November 8, be released within three days.

The government will also take responsibility for paying for any damage caused to both public and private property during the protest.

An inquiry will also be ordered into a government security crackdown on Saturday which saw thousands of riot police fire tear gas, rubber bullets and water cannon in an attempt to disperse the protesters.

Demonstrators fought back with stones, sticks and metal rods, and were able to beat back the authorities.

At least five people were killed and more than 217 - mostly members of the security forces - wounded in those clashes.

Minister accused of 'blasphemy'

Law Minister Zahid Hamid had been accused by clerics of committing blasphemy due to a change in the wording of an oath taken by parliamentarians in the South Asian country.

The protesters, led by Rizvi and other clerics, perceived the change in wording to represent a softening of the State's position against members of the Ahmadi sect, who are not permitted to identify themselves as Muslims in Pakistan.

The law was hastily amended back to its original wording, but protesters held the capital under siege for weeks, demanding that Hamid resign from the cabinet.

Law Minister Zahid Hamid had been accused of blasphemy due to a change in the wording of an oath taken by parliamentarians [T. Mughal/EPA]

According to the agreement signed on Monday, the government will also make public an internal inquiry into how the wording of the parliamentary oath was changed.

The Tehreek Labbaik Pakistan (TLP) political party, led by Rizvi, has also agreed not to issue any religious edicts [fatwas] against Hamid.

Blasphemy is a sensitive issue in Pakistan, and certain forms of it can carry the death sentence. Increasingly, those accused of blasphemy have also been subjected to violent attacks by mobs and charged protesters.

Since 1990, at least 73 people have been killed over alleged blasphemy, according to an Al Jazeera tally. They include those accused of blasphemy, members of their families, lawyers who have defended them and judges.