Updated

Pakistani lawmakers voted Tuesday to allow military courts to prosecute terrorism-related cases in the latest government effort to get tough on militancy in the wake of last month's Taliban school massacre.

The legislation passed both houses unanimously and now must be signed by the president. It will become effective immediately and will last for two years.

Following the Dec. 16 attack that left 150 people dead — most of them students — the government has scrambled to find ways to combat widespread Islamic militancy. The prime minister lifted a death penalty moratorium and then announced a proposal to allow military officers to rule on civilian terrorism cases.

"Military courts come into force in war time, and we are at war," said Interior Minister Chaudhry Nisar Ali Khan in an address to parliament Saturday defending the proposed changes.

The government has sought to allay fears that the courts would be used to persecute political opponents or try non-terrorism related cases. Speaking to legislators Tuesday, Prime Minister Nawaz Sharif said the government would decide what cases will be heard in the military courts. He said many "hard-core terrorists" arrested during military operations and currently in internment centers would be tried in military courts.

Pakistan's overburdened legal system has often struggled to deal with terrorism cases. There is no protection for judges, witnesses and prosecutors. Police investigations are often flawed, and authorities complain that if they bring a case against a suspected militant it is often thrown out.

But little information has been released about exactly how the military courts would function and what civilian oversight they would have. Critics have questioned the wisdom of handing over so much responsibility to the military, and whether the government will do anything over the next two years to improve the civilian courts.

"The failings of the judiciary are many. However, military courts do not address any of them. Instead of empowering a weak judiciary to fairly convict terrorists, we replace them with military courts," wrote Lahore-based lawyer Saroop Ijaz in the English-language Express Tribune newspaper.