He defied a military dictator, sacked a prime minister, and persistently sought to call generals and intelligence chiefs to account.
He became a symbol of hope for an impoverished multitude, seeking to assert their rights in a land where these are frequently ignored and abused.
He was one of his country's best-known figures who was seen — though not usually heard — on his nation's television screens as frequently as celebrity actors and cricket stars.
For any judge, in any land, this is an improbable record. In Pakistan, where for much of its history the judiciary was a puppet of the executive, it is remarkable.
Pakistan's Chief Justice Iftikhar Chaudhry has just retired after a tenure that is threaded through with contradictions, missteps and controversies, but that changed the balance of power in his turbulent nation.
He exited in thunderous style, delivering a farewell speech Wednesday before the Supreme Court in which he urged his fellow judges to defend the judiciary's independence, and issued a somber warning to his 180 million fellow Pakistanis.
"It seems that the divide between the haves and have-nots is increasing day by day, with the executive being unable to curb this growing disparity," said Chaudhry.
"Until we can tackle the ever-growing cancer of corruption, the rich will keep getting richer and the poor will keep getting poorer," he said.
Chaudhry, 65, spent his final days on the bench delving into one of Pakistan's murkiest corners: the fate of "missing persons" who have been "disappeared" by the security agencies and are either being secretly held in prison, without trial, or are dead.
He ran into stubborn resistance from the authorities, but Pakistan's Defense Ministry eventually produced six men who were led into the Supreme Court with their heads concealed by blankets. Pakistani activists say there are thousands more.
Chaudhry countered with a ruling explicitly forbidding the intelligence agencies from detaining people without sharing information about their whereabouts with their relatives.
History, however, will remember Chaudhry chiefly as the leading player in a bare-knuckle showdown that transfixed the outside world and ultimately led to the downfall of Gen. Pervez Musharraf, who is now facing trial for treason.
The judge and the dictator got off to a good start. Chaudhry was among those who signed an oath that, in effect, legitimized the coup in which Musharraf, then chief of the army staff, seized power in 1999.
Their standoff began in 2007 when Musharraf suspended Chaudhry as chief justice, and later fired him. This triggered a rolling political crisis that the general could not contain, despite imposing a state of emergency.
Lawyers took to the streets to protest Musharraf's brazen interference with what was supposed to be a foundation stone of the state — an independent judiciary. Civil rights activists, opposition political parties and the media joined in.
Chaudhry became their figurehead, driving from city to city — accompanied by dozens of TV crews — at the head of large and angry convoys of chanting protesters who were determined to bring an end to military rule. Along the way, the Pakistani public turned out in large numbers to cheer and throw flowers at the passing judge.
In more stable countries, the retirement of a chief justice would merit a news story or two. But, though now under civilian rule, Pakistanis remain acutely aware of the fragility of their civil institutions and of the far-reaching, behind-the-scenes influence of their military and intelligence services.
So, in the past few days, Chaudhry's retirement — and the energetic debate about his legacy — has filled Pakistan's airwaves, entirely outshining the ceremonies marking the death of Nelson Mandela.
Reviews of the chief justice's career range from ecstatic to disapproving.
The Daily News describes him as "a shining star" who "turned the country's tame and obedient judiciary into a pillar of strength and freedom for everyone but the corrupt and the incompetent — the undeserving elite that has ruled this country."
The common theme of the judge's many critics is that he overstepped the mark. He set up a human rights cell in the Supreme Court, which received hundreds of petitions a day from the public to ensure, as he puts it, "the man in the street is also within reach of justice."
But Chaudhry's liberal use of suo moto powers (when a court initiates action of its own accord) to probe into a variety of issues led to accusations that he had strayed into political activism, and too often interfered with the running of government.
These complaints reached a crescendo last year when he ordered the removal of Prime Minister Yousuf Raza Gilani for failing to obey court orders relating to corruption allegations against the then-president, Asif Ali Zardari.
There are now calls for limits to be placed on the court's suo moto powers — raising the possibility of another shift in the balance of power in Pakistan, in favor of the government.
It is too soon to say to what extent the new chief justice, Tassaduq Hussain Jillani, would fight against this. He has a reputation for being mild-mannered; he is also due to retire this summer. (He got the job because he was next in line.)
As for Chaudhry's future, the law says a retired chief justice cannot run for office for two years.
Yet few in Pakistan believe this battle-hardened, steel-nerved campaigner has permanently departed the limelight for a cozy retirement.
The judge will be back.