The agreement between Islamabad and local pro-Taliban fighters was reached after talks in Peshawar between members of Tehrik-e-Nifaz Shariat Muhammadi and officials of the North West Frontier Province (NWFP) government on Monday.
The Tehrik-e-Nifaz Shariat Muhammadi, or the Movement for the Implementation of Islamic Law, has long demanded the implementation of sharia in the region.
Officials gave few details of the kind of sharia they were planning to implement in the Malakand region, which includes Swat valley, but said that laws that fail to comply with Islamic texts would be suspended.
"All un-Islamic laws related to the judicial system, those against the Quran and Sunnah, would be subject to cancellation and considered null and void," an NWFP spokesman said in a statement following the talks.
Armed Muslim groups aiming to introduce sharia have been fighting government troops in the region since 2007.
They gained control over most of the valley after a 2008 peace deal collapsed within months of being signed.
Much of the violence, which has left hundreds of thousands of people homeless, has been blamed on the Taliban in Swat, headed by Mullah Fazlullah, the son-in-law of Maulana Sufi Muhammad, the leader of Tehrik-e-Nifaz Shariat Muhammadi.
Al Jazeera's Kamal Hyder, noting that Swat had a precedent of sharia implementation, pointed out that the majority of people in the area were very conservative.
Residents want sharia because they say the justice is swifter, he said.
He pointed out that judges would still be appointed by Pakistan's government.
The US, which is battling Taliban and al-Qaeda groups in the area, has previously said that such deals only serve to allow fighters to regroup.
Speaking in India, Richard Holbrooke, the US special envoy to the region, did not directly address Pakistan's move but said the rise of the Taliban in Swat underscored the point that "India, the US and Pakistan all have a common threat now".
"I talked to people from Swat and they were frankly quite terrified ... Swat has really deeply affected the people of Pakistan," he said.
Raja Asad Hameed, a legal correspondent at the Nation, said that the introduction of sharia in northwest Pakistan is a mere continuation of laws enshrined in the constitution.
"The government had very little elbow space. The military operations [in Swat] has never solved so many problems as those they have raised. It is a good move [to allow sharia], an overdue move and a significant one, politically and strategically," he told Al Jazeera.
But Imtiaz Gul, a political analyst, said that while Islamabad may have negotiated a deal in its interest, it had ceded some of its power over Swat, an area it had traditionally controlled.
"I think the entire leadership in Pakistan, both military and political, had arrived at a consensus that the cost of the military operation was becoming too high to continue, and that perhaps they should try the political power ... to get peace into the Swat valley," he said.
"In the process, they have given in to demands that have been in the Swat valley since 1995. We call it a surrender by the state."
Pakistan says that force alone cannot defeat all opposition groups, and that talks must take place, although several past deals have failed.