Early in Joshua Oppenheimer’s astonishing documentary “The Act of Killing,” a former torturer and mass murderer by the name of Anwar Congo dances a cha-cha on a rooftop where, earlier in his life, he routinely beat to death and strangled an untold number of innocent people.

Later in the film and back on that rooftop, Congo is a quite different figure. Literally convulsing, he is overwhelmed by ghosts and shame, a reckoning brought on by participating in Oppenheimer’s elaborate psychodrama about Indonesia’s historical genocide.

A horrifying yet mesmerizing work, “The Act of Killing” instructively meanders at times as in a Werner Herzog film. (Herzog is an executive producer on “Killing,” along with fellow documentary maker Errol Morris.) Oppenheimer’s strange approach — both investigative and outré — rewards one’s patience.

A 1965 military coup in Indonesia led to mass killings of people labeled “Communists.” The film says that, for decades, the government outsourced most of this dirty work to gangsters and paramilitary groups.

Save 75% on a Digital Subscription Today

It is these players in organized sadism — some active today — who enthusiastically agree to be the film’s subjects. Incredibly, these movie-mad monsters stage scenes for Oppenheimer of torture, rape and the burning of villages. Initially, the elderly Congo claims making a Hollywood-like production will justify past crimes, but the process clearly proves haunting for him.

The results are often surreal but also frequently shocking. Congo and his allies know what real brutality looks like, and they add nightmarish detail to simulations.

At times, ordinary men, women and children pressured by gangsters into playing extras clearly look traumatized, raising an ethical question about Oppenheimer’s efforts to get at unspeakable truths. But as a look at self-justifying evil and its toll on the conscience of at least one evildoer, this is a remarkable film.

Tom Keogh: tomwkeogh@yahoo.com