ISLAMABAD: Minister for Education and Professional Training Shafqat Mahmood on Saturday said legislation on the extension of Chief of Army Staff (COAS) General Qamar Javed Bajwa would be made with consensus of all the political parties in the parliament. The government was ready to consult with all the opposition parties including Pakistan Peoples Party and Pakistan Muslim League-Nawaz on the issues of national interest, he said talking to a private news channel. The minister urged all the political parties to show maturity and unity over national security issues.

Gen Bajwa’s future was thrown into doubt when the court had originally moved to block a fresh three-year term granted in August, saying the government had given insufficient reasoning for the extension and that no single figure was essential to ensuring Pakistan’s security.

Newspapers, which had suffered increasing censorship, declared it a seismic moment in the long-standing struggle between civilian and military arms of government. But the court then relented, giving an interim extension and setting Imran Khan’s government six months to bring in clarifying legislation about extending an army chief’s term of office.

“We are showing judicial restraint although there is no provision in law to grant an extension,” said Asif Saeed Khosa, the chief justice. “We leave this matter to parliament to make law regarding this.”

The relationship between an army chief and prime minister is historically fractious. In a concession to Pakistan’s democratic institutions, considered supreme in the constitution, the prime minister picks one of three candidates selected by the military.

The leader of the previous government, three-time prime minister Nawaz Sharif, was ousted in a 1999 coup by General Pervez Musharraf, whom he had chosen.

In 2016, Sharif successfully fought off a campaign to grant Musharraf an extension.

Khan’s government, which contains members who served in periods of military rule, is considered the most aligned with the wishes of Pakistan’s armed forces in decades. He welcomed the court’s decision, saying: “Today must be a great disappointment to those who expected the country to be destabilised by a clash of institutions.”

Analysts said that Gen Bajwa was likely to eventually win another three year-term, despite rising opposition to Mr Khan’s government.