Pakistani critics of the agreement, which was signed on Monday by Asif Ali Zardari, Pakistan's president, say it could bring about the "Talibanisation" of large areas of the country along the border with Afghanistan.
"I believe that politicians have capitulated," AH Nayyar, an analyst at the Sustainable Development Policy Institute in Islamabad, said.
"This is going to badly impact the future of Pakistan and open [the] floodgates for Talibanisation," he said.
Nayyar predicted that the entire province of Malakand, which includes the Swat valley, would fall to pro-Taliban groups within the next few months.
"I also see there will be pressures by Taliban in other provinces and Pakistan is going to go back to the dark ages," he said.
The United States and its Western allies have also expressed their fears that the valley will turn into a sanctuary for fighters from across the border in Afghanistan.
Pakistan's government lost control in Swat after Maulana Fazlullah, a local Muslim leader, launched a campaign to enforce sharia there.
During the government's battle against the Taliban in Swat, hundreds were killed, schools were bombed and tens of thousands of people fled their homes.
'Law at gunpoint'
Zardari had referred the deal to Pakistan's parliament, which voted on Monday to compel him to sign the deal.
"It is hoped that those who wanted this law in Swat will now surrender their arms and also bring the peace"
Rehman Malik, Pakistani interior minister
Legislators from the Muttahida Qaumi Movement, a party based in the southern city of Karachi that has a strong anti-Taliban stance, walked out of the parliament session before the vote.
"We can't accept Islamic law at gunpoint," Farooq Sattar, a party leader, said.
But despite the boycott, Pakistan's parliament voted unanimously to adopt a resolution urging Zardari to sign the deal and many hope the deal will help bring peace.
"God willing it will have a positive impact on the situation in Swat," Rehman Malik, Pakistan's interior ministry chief, said.
"It is hoped that those who wanted this law in Swat will now surrender their arms and also bring the peace."
'Will of the people'
Al Jazeera's Kamal Hyder, reporting from Islamabad, said many believe the government's decision merely represents the will of the people.
"There will be people who say this was giving into the demands of the Taliban in Swat, but other people will tell you that there has been a precedence for sharia law, that before Swat was amalgamated into Pakistan, the place was governed by sharia," he said.
"So in the interest of peace, the political parties in power have indeed made a dramatic move and supported the will of the people of Swat."
Amir Izzat Khan, a spokesman for Sufi Mohammad, a pro-Taliban Muslim leader who helped mediate the agreement, said that the deal would allow peace in Swat.
"We will make all-out efforts to establish peace in the region. The Taliban have disarmed themselves and those who have not yet disarmed will do so soon," Izzat Khan said.
Muslim Khan, a Pakistani Taliban spokesman, said that, with the deal in place, "there will be no need to fire a bullet".
"Women will not be allowed either to go to jobs or markets because we do not want to make them show-pieces," he said.
Even without the president's approval, judges trained in sharia had begun hearing cases in Swat, and witnesses say Taliban fighters effectively control of much of the region.