A joint press conference on Sunday said negotiations had been successful “after sense prevailed over aggression”, following clashes in which several police officers and protesters were killed.
The parties did not, however, reveal details of the agreement, which followed unconfirmed media reports that the government might free the Tehreek-i-Labbaik Pakistan (TLP) leader in return for assurances protests would end.
Mufti Muneeb ur Rehman, a prominent cleric involved in negotiations, said the details of the agreement would be shared at an “appropriate time".
On Sunday, the country was waiting to see if TLP members would end their sit-in blocking the main Lahore to Islamabad road at the city of Wazirabad, in Punjab province.
A deal would end the latest confrontation with a political party that has repeatedly threatened to paralyse the country in the past 12 months.
It has demanded sanctions against France, following the publication of cartoons deemed blasphemous against Islam.
Yet deals to end previous demonstrations have proved short-lived, and have led to accusations that Mr Khan's government has caved in to religious extremists.
This latest negotiations began more than a week ago when the TLP threatened to march from Lahore to Islamabad to demand the release of its jailed leader Saad Rizvi.
The TLP also wants the expulsion of France's ambassador over the publication in a French satirical magazine of caricatures depicting the Prophet Mohammed.
At least seven policemen were killed and of people dozens hurt in separate clashes when officers attempted to stop the march in Punjab province last week.
Police said members of the TLP had opened fire on constables trying to stop the march.
Mr Khan's government responded by using antiterrorism powers to mobilise paramilitary troops in Punjab for the next two months.
Pakistani newspapers reported at the weekend that Mr Khan had told clerics he was prepared to release Mr Rizvi, in return for assurances that protests would end.
Mr Ur Rehman told reporters: “The government of Pakistan and the TLP had a detailed discussion under an environment of mutual trust, and an agreement has been reached between the two sides.
“The agreement was reached after sense prevailed over aggression, rationality prevailed over sentiments and all the participants demonstrated patience.
“I want to urge the entire nation that this is not the victory of any individual, but it is the victory of Islam, patriotism and protection of human lives.”
The TLP was founded only six years ago, but in that time has become the most powerful force in Pakistan's street politics and has held successive governments to ransom.
The radical Sunni Muslim group has focused heavily on attacking actions it considers blasphemous, and has rallied vast support that it can mobilise for street protests and sit-ins.
The TLP was behind major anti-France protests in November 2020 and April this year, leading Paris to advise all French citizens to leave the country.
Large protests by the group in November 2017 against the former Pakistan Muslim League government led to the resignation of the law minister, after the TLP objected to changes to an election law.
The Supreme Court's acquittal of Asia Bibi, a Christian who spent 10 years on death row after she was falsely accused of blasphemy, caused another wave of protest.
Analysts have viewed the appeasement and encouragement of the TLP as an attempt by the military establishment to harness religion as a political tool.