Hamid's resignation comes in the aftermath of deadly clashes between security forces and protesters during the weekend, that killed six people and injured hundreds. The sit-in had paralysed the national capital for three weeks.
An official of the Prime Minister House confirmed that the law minister last night sent his resignation to Prime Minister Shahid Khaqan Abbasi, who accepted it today.
Hamid was accused by the protesters of blasphemy after a reference to the Prophet Muhammad was left out of a revised version of the electoral oath. He called it a clerical error.
Activists of Tehreek-i-Khatm-i-Nabuwwat, Tehreek-i-Labaik Ya Rasool Allah (TLY) and Sunni Tehreek Pakistan (ST) religious groups started protests three weeks ago.
More From This Section
Official sources said an understanding was reached with protesters with the help of the powerful Army to call off the protest as their key demand had been accepted and the changes made in the law had already been taken back when parliament restored the original oath.
Following the agreement and the subsequent resignation of Hamid, TLY chief Khadim Hussain Rizvi ordered his followers all over the country to end the sit-ins and go home.
The civilian government is being criticised for backing down in the crisis, which raises new questions about the military's role in politics in this country.
The right wing cleric, who parlayed life in Islamabad and neighbouring Rawalpindi, said his party was not in favour of violence. He said all of his supporters arrested during crackdown would be released by the government.
He also expressed anger at media for not showing his announcement live and threatened that media persons would not be allowed to leave the venue until his announcement was shown on channels. But he later allowed reporters to go.
"The court had asked the government to clear the roads and not for an agreement with protestors. What you have done is surrender," the judge told Interior Minister Ahsan Iqbal.
He also used strong words against army's role to mediate the agreement, when the minister said the agreement with the protesters was reached with the help of the Army.
"Who is the Army to play the role of mediator?...Where does the law assign this role to a Major General?" he asked.
Justice Siddiqui told Iqbal that the government had constitutional right to call in Army to help civil administration in any emergency situation.
He also said the "Army chief is an officer in an institution that comes under the state" and rhetorically asked "Is he above the law?"
Later in the day, the government opened the Islamabad Expressway linking the capital with its only airport and thickly populated suburban areas along the highway.
Radio Pakistan said that Hamid, the minister for law and parliamentary affairs, "voluntarily" presented his resignation to Abbasi to bring the country "out of a state of crisis".
They had linked the action to blasphemy -- a highly contentious issue in the Muslim-majority Pakistan.
Hamid said in resignation that the Election Act was formulated by a parliamentary committee comprising members belonging to all political parties.
According to the agreement, government would take back all cases against protesters and make public the probe regarding the changes in the oath and also punish those who were responsible for crackdown on protesters.
The agreement lauded efforts of Army Chief General Qamar Javed Bajwa for playing key role in peacefully ending the stand-off, which became possible after an important meeting between Bajwa and Abassi yesterday.