Pakistan's parliament passed a law on Wednesday giving security forces sweeping powers to clamp down on militancy, but some activists and legislators criticised the provisions as too harsh.
The legislation, known as the Protection of Pakistan Ordinance, must now be signed into law by the president.
The debate over the law follows months of high-profile Taliban attacks and this month's offensive by the Pakistani military against militant sanctuaries in the remote border region of North Waziristan.
Opposition senators had managed to water down some of the law's most punitive clauses, said Senator Afrasiab Khattak.
"It is still a very harsh law though," Khattak said by telephone. "We will be raising these issues again when the law comes up for renewal in two years."
The revised legislation, he said, allows suspects to be held for questioning for 60 days without charges being laid instead of 15 days permitted at present. Senior police officers will be empowered to issue orders to shoot to kill suspects.
It allows prisoners to be held at secret facilities but provides for some judicial oversight. Warrantless searches are allowed, but the evidence and cause must be presented in court within two days.
In its original form, the bill was far more harsh.
It is intended to replace Pakistan's outdated 1997 law, which has been the main piece of legislation used to counter growing militancy in the South Asian nation of 180 million.
But Fawad Chaudhry, a media adviser for the opposition Pakistan People's Party, said the old law had not been used properly and he doubted that this one would be either.
Hundreds of Pakistanis have been held for years in secret prisons without being charged. Extrajudicial killings by the security forces are also common.
"The passing of legislation is hardly a problem. The problem is the implementation," he said by telephone.
Pakistani courts rarely convict high-profile militants. Police are not properly trained how to gather evidence, and judges and prosecutors are frequently subjected to death threats.
Chaudhry said sometimes court officials also were sympathetic to militant aims.