On my first trip to New York - back in the mid- Eighties - I paid a visit to the United Nations, an institution then held in somewhat higher esteem than it is now. In the plaza outside, a demonstration was in progress. The protesters were Afghan men, their nationality manifest in their dress - they wore flowing pyjamas, a long loose shirt, and a circular woollen cap - and in their appearance they were tall, sharp-featured, and bearded. "Down with Soviet Imperialism!" they shouted: "Down! Down! Down!" "Death to Gorbachev!" they went on, "Death! Death! Death!" Then they added: "Death to Rajiv Gandhi! Death! Death! Death!"

Winston Churchill once said that while he was happy to criticise his country within its borders, while travelling overseas he would seek always to defend it. By the same token, while I was no fan of Rajiv Gandhi when living in Calcutta, to see him publicly abused in the middle of New York was an unnerving experience. He was, after all, the democratically elected prime minister of my country. Besides, the abuse carried with it a death threat.

At the time, I was teaching in a university up the coast from New York. The janitor in my department was a tall, cheerful Afghan who answered to the name of Sammy (shorthand perhaps for Samiullah). After a few months of exchanging pleasantries, I asked him about a man who was a hero to Indians of my generation, Khan Abdul Ghaffar Khan, the Frontier Gandhi, the man who taught the warlike Pathans to resist imperialism non-violently. Sammy exploded in disgust: "That man," he said, "was a f... Soviet agent!"

Also teaching in the same university was the political scientist, Barnett Rubin. Starting out as a specialist on this country - he had done his PhD at the University of Chicago with the old India hands Lloyd and Suzanne Rudolph - Rubin was then shifting his focus to Afghanistan (he is now, 20 years later, recognised as one of the world's greatest authorities on that unhappy land). He invited an Afghan refugee politician to speak, and asked me to come along. I cannot exactly recall the contents of the talk, but do remember what happened at its conclusion. As I walked out, the speaker - a thick-set, bearded man with a large turban - came up to me. Indira Gandhi should not have supported the Soviet invasion of Afghanistan, he said: "After all, your people and mine have such long and close ties. And India commands such great respect in Asia and Africa. If Mrs Gandhi had come out against the invasion, then other countries would have also followed suit."

The remarks were made more in sorrow than in anger (unlike the slogans against Indira's son shouted in the UN Plaza). But they were made with some feeling, and were unprompted. Recognising me as the only Indian in the room, the speaker had spontaneously expressed his disappointment at a close friend of his country letting it down in its hour of need.

The fact that Pakistan had fought three wars against India and that the US had not been an especial friend of India provided a sort of retrospective validation to Indira and Rajiv Gandhi for their support of the Soviet invasion. But that support certainly ran counter to the traditions of the Indian national movement.

 •  Delhi's Tibetan glitch

It was in December 1979 that Soviet tanks rolled into Kabul. In power in New Delhi was a minority government headed by Chaudhury Charan Singh. It was a regime based on ambition and opportunism - among the few items to its credit (it may be the only one) was that it made some noises of protest at the Russian invasion of Afghanistan. However, that government was already on its last legs, and when fresh elections were held in January 1980, the Congress came back to power. Indira Gandhi was once more prime minister, and she quickly endorsed the Soviet action. The influential pro-Soviet journalist, Nikhil Chakravarty, visited Kabul and wrote a series of effusive reports on how the new regime was dismantling feudalism and building a socialist utopia.

After Indira Gandhi's death, her support of the Soviet-backed regime in Kabul was endorsed by her son and successor as prime minister, Rajiv. Meanwhile, a resistance movement was taking shape among the Afghans. The insurgency had various strands, these differentiated by ethnicity - Pathan, Uzbek, Tajik - and by ideology - secular nationalist, Islamic jihadist, warlordist. It was funded principally by the United States of America, whose agent on the ground was Zia-ul-Haq's government in neighbouring Pakistan.

The fact that Pakistan had fought three wars against India and that the US had not been an especial friend of India provided a sort of retrospective validation to Indira and Rajiv Gandhi for their support of the Soviet invasion. But that support certainly ran counter to the traditions of the Indian national movement. For the Soviets in Afghanistan were, like the British in India or the French in Algeria, colonialists who had forced their rule on an unwilling populace. And despite the divergences within the resistance movement, it was clear that a vast majority of Afghans regarded the Soviets as usurpers and conquerors. And yet the 'anti-colonial' Indian government took the side of the alien rulers.

It is instructive to recall the Indian position on Afghanistan in the Eighties at this moment, when the Indian position on Myanmar (Burma) has come under searching scrutiny. In these columns, Sanjib Baruah has rightly criticised the false rhetoric of realpolitik that has been used to justify our support for the generals in Yangon. Let's not rush to endorse the democracy movement, say the amoral pundits in Delhi, for then the junta will go over wholesale to the side of the Chinese. Moreover, we need their gas, their timber, and their jewels. Back in the Eighties, these same pundits supported the government in Kabul on the grounds that our ‘friends' the Soviets were behind it, while our ‘enemies' the Pakistanis were against it.

The Burmese regime of the present day is brutal and authoritarian, whereas the Afghan regime of the Eighties was brutal and colonialist. Home-grown tyrannies are bad enough; but tyrannies imposed from outside are arguably even worse. The Indian support for the Soviets in Afghanistan ran contrary to our professed belief in national self-determination. Ironically, the same government, and indeed the same prime minister, had taken a more principled position with regard to an earlier example of imperialist aggression - namely, the American invasion of Vietnam. In March 1966, just weeks after taking over as prime minister, Indira Gandhi visited Washington. "New Indian Leader Comes Begging", was how one American paper headlined its story on the trip. This was not inaccurate - for the Indians were desperate for American food aid after the monsoons had badly failed in 1964 and 1965. While sanctioning the aid, President Lyndon Johnson asked in exchange for India to abstain from criticising American actions in Vietnam. This Indira Gandhi refused to do. A little later, the Indian position was made clearer when President Radhakrishnan wrote to Johnson urging that "the United States unilaterally and without any commitments cease bombing North Vietnam".

In the same way, the Indian silence on Burma is in sharp contrast to our consistent support for the democratic opposition in apartheid-era South Africa. After Nelson Mandela was freed from prison, the first foreign country he chose to visit was India, on the grounds that it had done more than any other to help the freedom struggle in South Africa. Mandela himself deeply admired Jawaharlal Nehru and Mahatma Gandhi; as, of course, does his fellow Nobel laureate, fellow democrat, and fellow jailbird, Aung San Suu Kyi. That makes our support for the Burmese generals now, and our support for the commissars in Kabul then, not just hypocritical and ironical, but also contemptible.