BANGKOK — It was an anti-Communist blood bath of at least half a million Indonesians. And American officials watched it happen without raising any public objections, at times even applauding the forces behind the killing, according to newly declassified State Department files that show diplomats meticulously documenting the purge in 1965-66.

In one of the documents, released on Tuesday, an American political affairs counselor describes how Indonesian officials dealt with prisons overflowing with suspected members of the Indonesian Communist Party, known by the acronym P.K.I.

“Many provinces appear to be successfully meeting this problem by executing their P.K.I. prisoners, or by killing them before they are captured,” said the cable sent in 1965 from the American Embassy in Jakarta, Indonesia’s capital, to the State Department.

Another cable describes how clerics from an influential Muslim organization in Indonesia advised their flocks that atheist “P.K.I. members are classified as lowest order of infidel, the shedding of whose blood is comparable to killing a chicken.”