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.
The Pakistani government has also agreed its troops will refrain from launching military operations in Swat as part of the deal.
The Tahrik-e-Nafiz Shariat Muhammadi, or the Movement for the Enforcement of Islamic Law, has long demanded the implementation of sharia in the region.
"This is not the first time Sharia law has been imposed in this area," Al Jazeera's Kamal Hyder said, reporting from Pakistan.
"In the mid 90s it was imposed following violent protests by the movement for the implementation of sharia law there.
"The majority of people in that area are very conservative. They have been demanding the implementation of sharia law because they say the other law takes far too long to dispense justice, and the demand is for swift justice.
"It will mean that the government is ceding territory to the Taliban, which will be a repeat of what happened when prime minister Benazir Bhutto was in power in 1994"
Shuja Nawaz, analyst,
South Asia Centre
"However, this will not mean that the groups opposed to the government will be dispensing that justice. The government of Pakistan will appoint the judges."
Shuja Nawaz, a strategic analyst with the South Asia Centre , told Al Jazeera that the agreement could prove problematic for Pakistan in future.
"It will mean that the government is ceding territory to the Taliban, which will be a repeat of what happened when prime minister Benazir Bhutto was in power in 1994 and a number of districts in Swat and Malakand were handed over to essentially the same group so they could impose their rather convoluted view of sharia on those districts.
"The moment you cede space to them, the Taliban will want to extend that control and then the government will have to go through this business of sending in the military yet again to clear and hold the territory."
The agreement is likely to draw criticism from the US, which is battling Taliban and al-Qaeda groups in the area. The US has said that such deals only serve to allow fighters to regroup.
But Pakistan says that force alone cannot defeat all opposition groups and that talks must take place, although several past deals have failed.
Unlike regions under tribal rule in the northwest, where al-Qaeda and Taliban fighters have found safe havens to launch attacks both in Pakistan and Afghanistan, the Pakistani government has typically controlled the Swat Valley.
Conservative groups aiming to introduce sharia have been fighting government troops in the region since 2007.
The groups took control there 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 Tahrik-e-Nafiz Shariat Muhammadi.
Regaining control of the Swat Valley - which was formerly a popular tourist destination - is a significant test for Pakistan's civilian leadership.
Separately on Monday, 16 people were killed when a suspected US drone fired two missiles at a target on Pakistan's border region with Afghanistan.
A security official in Pakistan's Kurram tribal region said that a building used by the Taliban was destroyed in the attack.
"Afghan Taliban were holding an important meeting there when the missiles were fired," an intelligence official in the area said.