THE 1999 coup that brought Gen. Pervez Musharraf to power in Pakistan was good for the country.
Mr. Musharraf proved himself to be an intelligent leader, and his popularity, particularly among the educated middle classes fed up with corruption and religious pandering by the country's traditional politicians, soared. He put Pakistan on the right side of world events after Sept. 11.
This makes his insistence on holding a referendum -- extending his grip on the presidency by five years -- all the more troubling and disappointing. What's the point? And why hold a referendum that was as brazenly and egregiously rigged as the one Pakistan endured this week?
Ballot boxes stuffed, registration rules ignored, civil servants and prisoners rounded up to vote -- it was a gala of fraud. Several Pakistani newspapers sent their reporters out to vote as often as they could, to see what would happen. Four ballots per person was typical.
The turnout was reported variously at 60 percent and at 2 percent. More likely it was somewhere in between.
Mr. Musharraf, results showed, got a 98 percent "yes" vote. Outsiders can only speculate as to how that was conjured up. Did 97 percent really seem too low to those who cooked the final figures? Was 99 percent really too high?
President Musharraf comes out of this referendum with less legitimacy, not more. Granted, his is not a country that has had a long history of legitimate rulers -- but it matters now, and to Americans, among others.
Pakistan has the potential to become an even bigger headache for the United States than Afghanistan is, because it is larger, more developed and geographically crucial.
In the northwestern tribal areas, al-Qaida fighters have apparently gathered among hospitable Pashtuns. Two battalions of the 101st Airborne Division have joined British marines in the mountains along the Afghan-Pakistani border, with another big battle evidently in the wings. Within Pakistan itself, Islamic extremists are legion. Most of those arrested by Mr. Musharraf last fall have been quietly released. Hundreds more have returned from captivity in Afghanistan.
Pakistan's Inter-Services Intelligence agency (ISI), which sponsored the Taliban, is of uncertain loyalty and intentions. Trouble with India over Kashmir is always a just a step away. And of course Pakistan has the nuclear bomb.
In October, Pakistanis are to go to the polls again, to choose a new parliament. It would be the first actual step toward a return to democracy. The conduct of Mr. Musharraf's government -- both during the election and afterward, in dealing with the new parliament -- will be crucial to the future course of the country.
But that election is still a long way away.
When the United States needed him, Mr. Musharraf turned out to be America's man in South Asia. He is still America's man, if only because he has had the foresight to recognize the truth that Pakistan's interests and America's coincide.
That's why Washington should be concerned and disturbed by the farcical exhibition that masqueraded as a referendum. The United States isn't helped by friends who look ridiculous.