In a majority 11-6 vote, the 17-member bench headed by Chief Justice Nasirul Mulk upheld parliament's decision to form the military courts, dismissing several identical petitions against the 21st constitutional amendment which set up the military courts.
The parliament adopted the amendment and the Pakistan Army Act, 1952 in January to set up special courts after the deadly Taliban attack on a military school in Peshawar on December 16 that killed over 150 people, mostly children.
The hearing was completed on June 26 but the court had reserved the judgement.
Earlier, the court had combined 31 petitions that challenged the powers of parliament to legislate on various issues. There were 15 petitions against the 21st amendment.
Today's verdict is the last major decision by Chief Justice Mulk who is set to retire on August 16.
The decision will lift the ban on military court which can now hold speedy trial of militants involved in heinous crimes.
"For extraordinary circumstances, extraordinary steps are required. With this decision, the war against terrorism will be strengthened and terrorists will be discouraged," Sharif said in his address to the National Assembly.
He also hailed consensus in the country against militancy and said that the Supreme Court's decision will add to the efforts against terrorism.
