Declassified files have revealed new details of US government knowledge and support of an Indonesian army extermination campaign that killed several hundred thousand civilians during anti-communist hysteria in the mid-1960s.

The thousands of files from the US Embassy in Jakarta covering 1963-66 were made public on Tuesday after a declassification review that began under the Obama administration. The Associated Press reviewed key documents in the collection in advance of their release.

The files fill out the picture of a devastating reign of terror by the Indonesian army and Muslim groups that has been sketched by historians and in a US State Department volume that was declassified in 2001 despite a last-minute CIA effort to block its distribution.

In 1965, Indonesia had the world's third-largest communist party after China and the Soviet Union, with several million members, and the country's president, the charismatic Sukarno, was vociferously socialist and anti-American.

US officials despaired of Indonesia's apparently unstoppable drift into the communist fold and were ecstatic when conservative generals imposed martial law in Jakarta, seized state radio and set out to annihilate the country's communist party on the pretext that it had tried to overthrow the government. Within months, the army would prevail in its power struggle with Sukarno, shifting Indonesia's political orientation to the US and opening its huge market to American companies.

The newly released files underline the US Embassy's and State Department's early, detailed and ongoing knowledge of the killings and eagerness to avoid doing anything that would hinder the Indonesian army. Historians had already established that the US provided lists of senior communist party officials, radio equipment and money as part of active support for the army.

The documents also show that US officials had credible information that contradicted the Indonesian army's lurid story that the kidnapping and killing of seven generals in an abortive coup by junior officers on September 30, 1965, which paved the way for the bloodbath, was ordered by the Indonesian communist party and Beijing.

The documents specifically mention mass killings ordered by Suharto, a general who within months would seize total power and rule Indonesia for more than three decades, and the pivotal role in carrying out the massacres by groups that today remain Indonesia's biggest mainstream Muslim organisations: Nahdlatul Ulama, its youth wing Ansor and Muhammadiyah.

A December 21, 1965, cable from the embassy's first secretary, Mary Vance Trent, to the State Department referred to events as a "fantastic switch which has occurred over 10 short weeks". It also included an estimate that 100,000 people had been slaughtered.

In Bali alone, some 10,000 people had been killed by mid-December, including the parents and distant relatives of the island's pro-communist governor, and the slaughter was continuing, the cable said. Two months later, another embassy cable cited estimates that the killings in Bali had swelled to 80,000.

A cable that was part of the 2001 State Department volume showed that by April 1966, the embassy was staggered by the scale of the murders and acknowledged, "We frankly do not know whether the real figure is closer to 100,000 or 1,000,000". Even the Indonesian government had only a "vague idea" of the true number, the cable said.

The release of the documents coincides with an upsurge in anti-communist rhetoric in Indonesia, where communism remains a frequently invoked bogeyman for conservatives despite the collapse of the Soviet Union nearly three decades ago and China's embrace of global capitalism.

Discussion of the 1965-66 period that departs from the Suharto era's partly fictional account of a heroic national uprising against communism is still discouraged. A landmark symposium last year that brought together aging survivors of the bloodbath and government ministers sparked a furious backlash. And last month, an anti-communist mob led by retired generals attacked a building in central Jakarta where activists had planned to discuss the killings.

"The mass killings of 1965-66 are among the world's worst crimes against humanity, and our country's darkest secret," said Veronica Koman, an Indonesian human rights lawyer.

"The 1965-66 survivors are all very old now, and I'm afraid that they will not see justice before they die. Hopefully with these cables coming to light, the truth can emerge and perpetrators can be held accountable."