As Megawati Sukarnoputri struggles to hang on to control of Indonesia in the latest round of political upheaval, news has been published of how the British government covered up one of the worst massacres of the 20th century. The slaughter in 1965 - of up to a million alleged communist sympathisers - was carried out by General Suharto, who ousted Megawati's father, President Sukarno, to become Indonesia's military dictator. What is still less well known is that the British and American governments did not just cover up the massacre: they had a direct hand in bringing it about.

In the era of decolonisation and the cold war, ex-colonial powers were intent on preserving their economic interests in former colonies while setting up nominally independent governments. But the natives, inconveniently, did not always see their interests as consonant with those of their former colonial masters. Patrice Lumumba in the former Belgian Congo, Su-karno in Indonesia - both argued for economic as well as political self-determination.

Lumumba was assassinated with the connivance of Belgium, the US and the United Nations. In Indonesia, the British and American governments succeeded not only in engineering the result they wanted (the replacement of Sukarno with General Suharto), but in selling a false version of events that persists to this day.

Roland Challis, a former BBC south Asia correspondent, has described how British diplomats planted misleading stories in British newspapers at the time. But there is also evidence that the British and US responsibility for the fall of Sukarno goes back to the event that triggered it - an alleged left-wing coup attempt in 1965. The British were keen to get rid of Sukarno because he was pursuing a policy of confrontation with Malaysia. The US was convinced that Sukarno would drift towards communism - a far bigger potential headache for US interests than Vietnam.

Sukarno was hugely popular and an assassination would have unpredictable consequences: at worst, it might benefit the Indonesian Communist party, the PKI. The army was divided on the merits of a move against him. There was one man, though, who was willing to help - the commander of the strategic reserve, General Suharto. The challenge was to engineer Sukarno's downfall and, simultaneously, the elimination of the PKI.

In October 1965, a group of what are still described as "progressive army officers" kidnapped and brutally murdered six army generals, apparently in preparation for a coup. The motives of the group remain a matter of dis pute. At the time, they were alleged to be in sympathy with the PKI. They have subsequently been described as pro-Sukarno nationalists in revolt against their rightwing superiors. But a study carried out at Cornell University in 1966 discovered that what most of the officers had in common was not any association with the PKI, but a connection with General Suharto.

Lt Col Untung, the alleged leader, was a successful military officer who was a known anti-communist. Some of his colleagues had been trained in the US where it is unlikely that any communist sympathies would have escaped notice. Suharto subsequently dismantled the unit and the group's alleged links with the PKI became the pretext for the massacre of up to 1m people. After a series of closed show trials and staged confessions, the leaders were said to have been executed, but there is no independent evidence that the executions took place.

It has been known for more than 10 years that the CIA supplied lists of names for Suharto's assassination squads. What is less widely known is that the supposed pro-communist coup that triggered the crisis was almost certainly also the work of the CIA. Sukarno was finally removed from power in 1967. Suharto, meanwhile, was offered economic aid and the British lifted their embargo on sales of military aircraft. Suharto's massacres were whitewashed in a campaign of disinformation in which the British government willingly participated. The operation to "save" Indonesia, according to enthusiastic reports in, amongst others, the Atlantic Monthly, was a resounding success. "Suharto," Atlantic Monthly assured its readers, "is regarded by Indonesians who know him well as incorruptible ... In attacking the communists, he was not acting as a western puppet; he was doing simply what he believed to be best for Indonesia."

Best for Indonesia, in Suharto's view, was the granting of lucrative concessions to western mining and oil companies. It was the beginning of a post-independence economic order that continues today. After 32 years, Suharto was finally overthrown. By then, even the US government had to admit that he was one of the most corrupt dictators of the 20th century.

comment@theguardian.com