DESPITE all the lipsmacking warnings from pundits and editorialists nostalgic for the issues of their youth, Afghanistan has not turned out to be “another Vietnam” for the United States.

That is not to say that the analogy is entirely inappropriate. It could just be misapplied.

Because if Afghanistan is another “Vietnam,” it is Pakistan’s.

Even more than we did in Indochina, Pakistan overestimated both the pliability of its client regime in Afghanistan, and the ability of the Taliban proxy army – with the help of Pakistani advisers – to either defeat the Northern Alliance or to control Afghanistan’s borders with the neighboring ‘Stans.

Pakistan reportedly even managed a facsimile of the Saigon embassy airlift in 1975 – except that the aircraft taking off from Kunduz as the city fell to the Northern Alliance weren’t packed with Pakistani diplomats and their families but a startlingly large number of soldiers, intelligence agents and al Qaeda terrorists.

The (incomplete) evacuation of these “assets” seems to have revealed the true extent of Pakistan’s continued involvement in Afghanistan, despite the assurances by Gen. Musharraf that Pakistan had abandoned its Taliban clients.

We have long known that Pakistan’s powerful intelligence service, the ISI, played a key role in the setting up of the Taliban (along with Saudi Arabia and the UAE), that it funded its activities using the Afghan heroin industry, and that it had a history of manipulating its contacts with the CIA to America’s disadvantage.

Now it seems that during the first part of this Afghan war that the people we trusted to interpret our local intelligence data were actively working for the other side. This is something we should bear in mind when we consider Pakistan’s demand to be involved in the establishment of a new government in Afghanistan, and when we think about the evolution of our own relationship with Pakistan after the war.

The understandable temptation will be to punish Pakistan for persistently double crossing us, perhaps by giving India the go-ahead for decisive action in response to Pakistan’s sponsorship of terrorism in Kashmir.

But we should also remember that the ISI, for all its power – and it is a state-within-a-state every bit as dangerous, corrupt and ruthless as conspiracists have wrongly imagined the CIA to be – had already lost influence in Pakistan when Gen. Musharraf officially threw his lot in with America rather than Osama bin Laden and Mullah Omar. And now that the ISI’s creation has all but lost in Afghanistan, the ISI’s influence should continue to diminish at home.

The same is true of the radical Islamism that the ISI fostered in Afghanistan and in the Afghan refugee camps in the Northwest Frontier, and which has long seemed to be expanding into a major political factor in Pakistan itself.

Of course many things about Pakistan’s failed colonial adventure in Afghanistan aren’t entirely clear, including the grand strategy that lay behind it. Perhaps Pakistan’s military planners believed that control of Afghanistan through the Taliban gave their country strategic depth in any conflict in India. Certainly the Taliban’s cosy relationship with al Qaeda facilitated the training and recruitment of terrorists for use in Indian Kashmir.

What is clear is that Pakistan’s military Islamists had delusions of grandeur. Control of Afghanistan was to be a step in the direction of Pakistan’s becoming the leading power in an Islamicized Central Asia.

They would continue to wage a terrorist campaign against larger, stronger, richer, nuclear-armed India, and they would end Iranian influence in Afghanistan, using their brutal Taliban clients who murdered Iranian diplomats with the same insouciance with which Iran’s clients murder foreign diplomats.

At the same time Pakistan would scorn American warnings and pleadings when it came to arms proliferation: building an “Islamic bomb,” and playing footsie with the Chinese and North Koreans for ballistic missiles to deliver its nuclear warheads.

Fortunately, when the United States resolved to go after al Qaeda in the wake of Sept. 11, Gen. Musharraf had the good sense and the courage to defy the ISI and some of his fellow generals, and to halt the overreaching that could have brought his country to the brink of war with the United States.

Just as fortunately, the presumptively radical Pakistani “street” turned out to be as overblown a threat to his regime as the Taliban were to us. In any case, the collapse of Pakistani ambitions in Afghanistan discredits Musharraf’s most dangerous opponents more than the man himself.

So, in one important sense Afghanistan was not Pakistan’s “Vietnam.” After all, our departure from Vietnam meant the tragic end to a possibly doomed but not ignoble attempt to forestall what proved to be a cruel tyranny.

Afghanistan, on the other hand, marked the end of an attempt by the worst and most cynical elements within Pakistan’s political class to spread tyranny and oppression.

With luck, Musharraf will use the destruction of the Taliban to purge some of its Pakistani sponsors, and then turn his attention to the urgent task of building a civil society in his own sad, battered land.