Pakistan has passed a law giving security forces sweeping powers to clamp down on terrorism, but many activists and politicians have described the provisions as draconian.

The new legislation adopted on Wednesday grants police officers the powers to shoot and kill alleged terrorists and detain suspects for questioning for up to 60 days without charge.

It also allows prisoners to be held at secret facilities, and the police to carry out warrantless searches.

The legislation, known as the Protection of Pakistan Ordinance, must now be signed into law by the president.

Al Jazeera's Kamal Hyder, reporting from Islamabad, said, parliament passed the bill despite considerable opposition, citing the need to show solidarity with the army and its military offensive.

Tahrira Abdullah, a human-rights activist, told Al Jazeera: "The government of Nawaz Sharif managed to sneak this bill through parliament.

Live Box 201461092013258101

"The police and armed forces are now able to shoot people if they see them commiting a crime, or suspect them of wanting to commit a crime in the future. This has huge implications for human rights."

The debate over the law follows months of deadly Pakistani Taliban attacks and this month's offensive by the Pakistani military against sanctuaries in the remote border region of North Waziristan.

Nearly half a million people have fled North Waziristan since the military launched a ground offensive against the Pakistani Taliban late last month.

The new legislation is intended to replace Pakistan's outdated 1997 law, which has been the main piece of legislation used to counter armed grouos in the country.

But Fawad Chaudhry, a media adviser for the opposition Pakistan People's Party, told Reuters news agency 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. Extra-judicial killings by the security forces are also common.

"The passing of legislation is hardly a problem. The problem is the implementation," Chaudhry said.

Source: Al Jazeera and agencies