It was, in President Bush’s own word, a “tense” encounter this week when Pakistan’s Pervez Musharraf and Afghanistan’s Hamid Karzai met at the White House. Although both are supposedly US allies in the “war on terror”, each has been blaming the other for a large share of the problems his country faces.

It was all oddly reminiscent of the situation a quarter of a century ago, following the Soviet invasion of Afghanistan. Then as now, the US was trying to fight an Afghan conflict with the support, alternately reluctant and embarrassing, of a military dictator in neighbouring Pakistan. Then as now, having a dictator on side is not a good look when you’re fighting for democracy; even less so when you have to keep giving him bribes to keep him on side.

But each time, the Americans just went along with the demands of Pakistan’s rulers. I was a very young commentator then, but in January 1980 I said the US administration had “announced measures designed to hurt, not the Russians — Heaven forbid! — but the Americans: ‘Let’s use our money to prop up another unsavoury dictator (this time in Pakistan), and earn the contempt we deserve.'”

Some progress has been made. As military rulers go, General Musharraf is a relatively mild specimen — certainly an improvement on Zia-ul-Haq, who ruled Pakistan until his assassination in 1988.

Musharraf’s trip to the US has not been a conventional state visit but more a promotional tour for his memoirs, whose content has seriously embarrassed the Americans. But his frankness and good humour, including Tuesday’s appearance on The Daily Show, is more likely to have won him friends than enemies.

And Karzai’s government, if it can survive, is an incomparably better option for Afghans than the choices they faced in the 1980s: a Soviet-backed puppet government in Kabul, and an alliance of warlords and Islamic fundamentalists (forerunners of today’s Taliban) controlling most of the countryside and backed by Pakistan and the US.