Politicians hope the deal will end a two-year insurgency
Pakistan's President Asif Ali Zardari has signed a controversial bill introducing Islamic Sharia law to the Swat region, say reports.
The move comes after parliament passed a resolution urging Mr Zardari to honour a promise made to the Taleban.
The implementation of Islamic justice was agreed in February in return for an end to the Taleban insurgency.
Mr Zardari had previously resisted signing the deal, which has been criticised by his Western allies.
There are concerns it could lead to human rights abuses and provide help to militants in the region.
But Prime Minister Yousuf Raza Gilani said parliament had committed itself to implementing the Sharia system.
The bill introducing Sharia courts in the troubled Malakand division, comprising six north-western districts including Swat, was sent to parliament for consideration on Monday.
Sharia court have already begun operating in the region, after reopening last week.
Mr Gilani told lawmakers that they had "committed to implement the system and the whole nation should support it".
"We want consensus of the whole nation. We want to take the house into confidence. We don't want to bypass the parliament," AFP news agency quoted him as saying.
The parliament then unanimously passed a resolution urging Mr Zardari to sign the deal.
One party, the Karachi-based Muttahida Qaumi Movement (MQM), abstained from the vote, with members saying they had "apprehensions" about the agreement.
"We can't accept Islamic law at gunpoint," the Associated Press quoted Farooq Sattar, an MQM party leader, as saying.
Mr Zardari had been expected to sign the bill directly into law.
The BBC's M Ilyas Khan in Islamabad says putting it before parliament was apparently meant to develop national consensus on an issue which is highly controversial and over which many within the country and abroad have expressed reservations.
The secular ANP party, which governs North West Frontier Province (NWFP) and which negotiated the bill with a cleric, Sufi Mohammad, was unhappy with Mr Zardari's decision to send the bill to parliament.
NWFP information minister Mian Iftikhar Hussain told the media the president had not discussed the change of tactics with the ANP.
A spokesman for the Taleban, Muslim Khan, told the Associated Press news agency that MPs who opposed the deal in parliament would be considered apostates.
Apostasy, or abandoning Islam, can in some areas mean the death penalty.
On Friday Sufi Mohammad said he was leaving the region in protest at the failure to finalise the agreement.
He had set up a peace camp in the main town of Mingora but on Friday said he was returning to his village in protest at the turn of events.
Swat is mostly under Taleban control. Thousands of people have fled and hundreds of schools have been destroyed since they began their insurgency there in 2007.
Sharia courts began operating last month and have been welcomed by many in the region as a quick and efficient means of justice.
However, there have also been reports of controversial punishments.
From the outset of the deal, the US feared it might "become a surrender" to militants.