The Supreme Court of Pakistan on Thursday cut Army chief General Qamar Javed Bajwa’s tenure extension from three years to six months, Dawn reported. The court had on Tuesday suspended the government’s decision to give Bajwa a three-year extension. His term was earlier scheduled to end at midnight.

The three-judge bench of the court directed the government to submit an undertaking that Parliament will pass legislation on this matter within six months, and that its notification will be amended, according to the newspaper. “If the legislation is not passed during the given time, the appointment will become illegal,” said the bench led by Chief Justice of Pakistan Asif Saeed Khosa, and comprising justices Mian Mazhar Alam Khan Miankhel and Syed Mansoor Ali Shah.

During the proceedings earlier in the day, the chief justice observed that there was an ambiguity in the Army Act. “Parliament has to remove that ambiguity,” said Shah, adding: “There is no better forum than Parliament to fix the system.” Miankhel said in the future the government should also clarify if the tenure will be extended or if there will be a reappointment, according to Dawn.

“Extensions were happening in the past but no one took notice of it,” said Khosa, according to The Express Tribune. “No one is watching what is happening in cantonments. Under which law is this practice continuing? Now a constitutional institution is reviewing this matter. The appointment procedure should be clearly written on the constitutional post.”

Pakistan Prime Minister Imran Khan said the verdict must be “a great disappointment to those who expected the country to be destabilised by a clash of institutions”. In another tweet, he added that his party was the first one to advocate for an independent judiciary two decades ago.