The judge next in line to lead Pakistan's Supreme Court was pushed aside by the military-backed government this week, right after it rushed through judicial reforms.
Just before dawn on Monday, parliament narrowly passed constitutional amendments granting lawmakers the power to select top judges.
The government said the amendments were designed to bring a wayward judiciary into line.
Critics see it as power grab driven by the military establishment's desire to rein in the political influence of the Supreme Court, which has issued a series of recent decisions favouring jailed opposition leader Imran Khan.
"Over the last couple of years, the judiciary has been a thorn in the side of the government of the day, particularly the military, which supports the present government," senior lawyer Salahuddin Ahmed told AFP.
"Eventually, they came up with this scheme to subjugate the judiciary through the constitutional amendment," he added.
The details of the amendments were kept secret from the press and public until they were read out in parliament in a late-night session.
In addition to picking the chief justice, the government will also now have increased representation in the judicial commission responsible for appointing, assessing and removing top judges.
New benches formed of senior judges from across the country will weigh exclusively on constitutional issues, which are at the core of the legal tussle between the government and Khan's Pakistan Tehreek-e-Insaf (PTI) party.
Santiago Canton, the head of the International Commission of Jurists (ICJ), called it "alarming that a Constitutional Amendment of great significance and public interest was passed in such a secretive manner and in less than 24 hours".
The overhaul was made on the cusp of Supreme Court Chief Justice Qazi Faez Isa's retirement on Friday, with his scheduled replacement sidelined by the government in favour of another judge.
Under the previous laws, he would have automatically been replaced by Syed Mansoor Ali Shah, generally considered politically impartial.
But Shah sealed his fate in July when he overruled the Election Commission and awarded a handful of non-elected seats reserved for women and religious minorities to Khan's PTI, which won the most seats in February's election.
The verdict would have made Khan's party the largest in parliament -- a killer blow to Prime Minister Shehbaz Sharif's shaky coalition government.
The Human Rights Commission of Pakistan said the reforms gave the government "a dangerous advantage".
"The manner in which constitutional benches are to be established, as well as their composition, raise serious concerns that, in practice, the credibility of these benches may be compromised by direct political influence," it said in a statement.
Constitutional lawyer Salahuddin Ahmed predicted a future "rat race amongst the senior judges" who will lean their rulings towards the government in order to get promoted to the top job.
United Nations High Commissioner for Human Rights Volker Turk said the amendments were passed "without broad consultation and debate" which "will seriously undermine the independence of the judiciary".
Pakistan's foreign office on Thursday rejected the statement, calling it based on "misinformation and inaccurate understanding".
Throughout Pakistan's history, the Supreme Court has had massive influence in charting the country's political course -- deciding whether to remove, disqualify or even hang prime ministers, as in the case of Zulfikar Ali Bhutto in 1979.
The top court's perceived political force has recently unnerved members of the establishment.
In a fiery speech in parliament, Bilawal Bhutto Zardari, the grandson of Zulfiqar Ali Bhutto and the son of slain former prime minister Benazir Bhutto, accused judges in Pakistan of growing accustomed to "interfering in matters of politics, foreign policy and the economy".
Legal expert and Supreme Court lawyer Osama Malik said the judiciary's activism has "provided the justification for an amendment that will not only erode the independence of the judiciary but also threaten civil liberties".
"While the government presents this argument as a sugar-coated explanation, its underlying goal is to bring the judiciary under its control," he told AFP.