The US government had intimate knowledge of the mass killing of alleged communists in Indonesia in the mid-1960s when half a million people were slaughtered, newly declassified documents show.

The documents also reveal that Indonesian army intermediaries told Western embassies they were considering toppling then President Sukarno less than two weeks after the mysterious killing of six generals that sparked the bloodletting.

The murder of the generals on September 30, 1965, is still widely depicted as an attempted communist coup against Sukarno.

The murders were used as a pretext for an anti-communist pogrom by Indonesia's military and proxy groups that led to at least 500,000 deaths.

One of the worst massacres of the 20th century, the killings in 1965 and 1966 have never been officially investigated and perpetrators have never faced justice.

One cable from the US embassy in Jakarta to the US Department of State, written three months after members of the communist party, the PKI, were first targeted, said there were "an estimated 100,000 PKI deaths".

Phelim Kine, deputy Asia director of Human Rights Watch, said redress for victims was "long overdue".

Indonesia's chief security minister, Wiranto, declined to answer questions. The army deputy chief of staff, H Siburian, said he had not seen the documents so could not comment.

The US embassy did not respond to requests for comment.

{articleGUID}

While the documents do not solve the mystery of why the six generals were killed in 1965, they do show the United States and its Indonesian military allies were deeply concerned about Sukarno's left-wing policies and ties to the communists.

Then US ambassador Marshall Green wrote on October 12, 1965, the army had approached Western embassies through an "intermediary" and said they were considering a "quick move" to overthrow Sukarno, although no final decision was made.

In the event of such a coup, Green said the US could help with "anything from covert operations and assistance transport, money, communications equipment, or arms".

In January 1967, Major-General Sjarif Thajeb told a US embassy official Sukarno planned to accuse foreigners and their "little army friends" of orchestrating the killings. The president's plan had galvanised the military "hawks" to overthrow Sukarno "by March".

Army General Suharto became acting president in March, ushering in three decades of military dictatorship.