Pakistan's parliament has approved a constitutional amendment enabling military courts to try civilians suspected of terrorism.
The legislation is the latest in a series of antiterrorism moves since December's school massacre in Peshawar.
The upper and lower houses of parliament both approved the constitutional change on January 6 in unanimous votes that allow the military courts to be set up.
Syed Khursheed Ahmed Shah, an opposition leader in the National Assembly, the lower house, said, "The bitter pill of this new law is being swallowed for the security of Pakistan."
But lawmakers from two religious parties, Jamat-e-Islami and Jamiat Ulema-e-Islam Fazal (JUI-F), abstained from the votes.
JUI-F leader Fazalur Rehman told reporters, "Some forces are trying to initiate a war between religious and secular forces in the country."
The amendment is expected to be approved by the president later this week.
It would be in effect for two years.
The constitutional change is designed to speed up the trials of alleged terrorists and protect the process from the intimidation of judges and witnesses.
Prime Minister Nawaz Sharif thanked the lawmakers who supported the amendment, saying, "This day is a very blessed day for Pakistan because the nation has decided to uproot terrorism and terrorists and throw them out."
He told members of the Senate, the upper house, "The nation should have a commitment that we will not sit contented till the last terrorist is killed."
Sharif added that the law was aimed only at "hard-core" militants.
The prime minister said last month that establishing military courts would help ensure that "terrorists pay the price" for their "heinous acts."
Pakistan has taken steps to crack down on militants since the Pakistani Taliban attacked a school in Peshawar on December 16, killing 142 children and nine staff.
But critics have questioned whether the legislation gives too much power to the military while doing nothing to actually improve the civilian courts.
In an editorial on January 6, Pakistan's English-language newspaper Dawn termed it a "sad day" and accused political leaders of being unable to defend the country's constitutional and democratic roots or resist the "generals' demands."
Rights activists have also criticized the government for lifting a six-year moratorium on the death penalty and executing terror convicts.
An annual report by the independent Pakistan Institute for Peace Studies showed that the number of "terrorist attacks" declined by 30 percent in 2014.
The report released on January 6 said 1,206 attacks were carried out by militant, nationalist/insurgent, and sectarian groups, including about 731 attacks by branches of the Pakistani Taliban.
It added that 1,723 people were killed in these attacks, including more than 1,200 in the ones perpetrated by the Pakistani Taliban.
The report said military operations in the northwestern tribal regions, where Islamist militants have bases, have helped improve security in the country.
With reporting by AFP and AP