“This is not justice but a joke,” Mr. Sharif said in Lahore during one of several recent, fiery speeches that have been critical of the court.
Justice Nisar, 64, who became chief at the end of 2016, defended the court’s choice of cases.
“We are being accused of accepting some cases, of being a part of an anti-democracy campaign, but the judges must not come under any pressure,” Justice Nisar said in a speech. The judiciary, he said, should not let “anyone suffer from injustice.”
The Supreme Court and lower courts have responded to speech critical of the judiciary by pursuing a number of contempt citations.
A governing party senator, Nehal Hashmi, was found guilty of contempt-of-court charges this month and sentenced to a month in jail. He had been accused of threatening violence against a panel set up by the Supreme Court to further investigate corruption allegations against Mr. Sharif. “Those who are seeking our accountability, listen with open ears: We will not spare you,” Mr. Hashmi told a party gathering, comments for which he later apologized.
Two government ministers have also been summoned to appear before the Supreme Court in contempt cases, and lower courts have issued contempt summonses to Mr. Sharif and his daughter and political heir, Maryam Nawaz, because of speeches critical of the judiciary.
Some analysts say the political motives in the clash belong primarily to Mr. Sharif and his allies.
“From the moment Sharif was disqualified in July 2017, he has consistently baited the judiciary, knowing that the only route to renewal for him is in successfully tainting the judiciary,” said Mosharraf Zaidi, a political analyst and newspaper columnist. “And the only way for the judiciary to be tainted is to demonstrably seem like it has an agenda outside of dispensing justice.”
Mr. Sharif and his allies have sought to tie the court’s agenda to the military’s, a link that has historical resonance. Mr. Sharif had long been at odds with the military, asserting that elected officials should take the lead in formulating foreign and security policy. His push for treason proceedings against a former dictator, Gen. Pervez Musharraf, who had toppled Mr. Sharif’s previous government in 1999, also rankled the military.
Other analysts fault the court. “The judicial activism is destroying the image of the judiciary and politicizing it more,” said Matiullah Jan, a journalist and talk-show host who covers the Supreme Court.
“It is unfortunate that both army and the judiciary are openly competing with the political government for popularity,” Mr. Jan added. “Both competitors are trying to derive their authority from the public rather than the Constitution and law.”
The judiciary in Pakistan has a history of being compliant to the military, giving it constitutional cover for undemocratic acts. But in 2007, Iftikhar Muhammad Chaudhry, a maverick, strong-willed chief justice, locked horns with Mr. Musharraf, igniting the grass-roots Lawyers’ Movement that helped lead to his resignation.
Mr. Chaudhry left a mixed legacy, though, unable to make lasting reforms and accused of self-aggrandizement. Subsequent chiefs have also failed to make a dent in the problems: The Supreme Court itself has a backlog of more than 38,000 cases, a symptom of a strained national system in which cases can drag on for decades.
Critics say that while Justice Nisar has been quick to take up cases related to the governing party and malfeasance by civilian authorities, he has sidestepped more delicate issues like the intelligence agencies’ practices of enforced disappearances, intimidation and harassment of the military’s critics.
Last month, Justice Nisar decided to re-examine the case of Husain Haqqani, an outspoken critic of the military who failed to return from abroad for a judicial inquiry into charges of improperly seeking American assistance to head off a possible coup. Mr. Haqqani, citing security threats, has refused to return from the United States, which has no extradition treaty with Pakistan.
The chief justice has, however, shown no sign of pushing for the return of Mr. Musharraf, who fled the country in the middle of his trial on treason charges. (In 2016, Mr. Musharraf acknowledged that a former army chief, Gen. Raheel Sharif, helped to influence the courts so that he could leave the country.)
For now, it seems that the clashes between the judiciary and Mr. Sharif’s party may only intensify.
“There is an air of confrontation.” said Ibn Abdur Rehman, 88, a leading human rights defender who suggests the court has overreached at times. “The judges should not start trying to solve the problems themselves.”
When Mr. Rehman appeared to give expert testimony recently before the Supreme Court, Justice Nisar said he wished he could invite the longtime activist to have a cup of tea.
“Instead of an invitation for tea,” Mr. Rehman responded in a low voice, “it is better to provide justice.”