Pakistan's Supreme Court said the military should not engage in political activities

In a rare rebuke to Pakistan's powerful military, the Pakistan Supreme Court on Wednesday stopped them from engaging in political activities and directed spy agencies like the ISI to operate within the law.

Delivering a landmark verdict on the 2017 Faizabad sit-in by the hardline Tehreek-e-Labbaik Pakistan (TLP) and other smaller groups, a two-member Supreme Court bench also ordered the Pakistani government to act against those propagating "hatred, extremism and terrorism".

"We direct the federal and provincial governments to monitor those advocating hate, extremism and terrorism and prosecute the perpetrators in accordance with the law," the bench comprising Justice Qazi Faez Isa and Justice Mushir Alam ruled.

The court directed all government agencies and departments, including those run by the army like spy agency Inter-Services Intelligence (ISI) to operate within the limits defined by the law. The bench ordered that members of the armed forces were prohibited from engaging in any kind of political activity, which includes supporting a party, faction or individual.

"The government of Pakistan through the Ministry of Defence and the respective Chiefs of the Army, the Navy and the Air Force are directed to initiate action against the personnel under their command who are found to have violated their oath," the court said.

Several experts were of the view that Prime Minister Imran Khan was supported by the country's powerful army in last year's general election.

Pakistan's military has ruled the country through various coups for nearly half of the country's history since independence in 1947. The military plays an important role in the country's decision-making.

The top court also outlawed religious edicts called fatwas that aimed to harm others. "A person issuing an edict or fatwa, which harms another or puts another in harm's way, must be criminally prosecuted under the Pakistan Penal Code, the Anti-Terrorism Act, 1997 and/or the Prevention of Electronic Crimes Act, 2016," the court ruled.

The court upheld that subject to reasonable restrictions imposed by law, citizens have the right to form and to be members of political parties. They can also assemble for peaceful protest.

It said the right to assemble and protest is circumscribed only to the extent that it infringes on the fundamental rights of others, including their right to free movement and to hold and enjoy property.