Riot police patrol during a protest on the Rio de Janeiro state economic crisis and against 2016 Rio Olympics, in Rio de Janeiro, Brazil, July 6, 2016. REUTERS/Ricardo Moraes

RIO DE JANEIRO — It could be a film noir script from the gothic underbelly of this tropical Brazilian metropolis, where crooked cops summarily execute suspected criminals, fake evidence when innocent bystanders are killed in the crossfire, and become embroiled in deals and kidnappings with drug gangs.

Instead it was a 115-page report, called "Good Cops Are Afraid," from the New York-based nonprofit group Human Rights Watch that asked Rio police why they kill. The answers are disturbing and compelling, as officers describe crimes they witnessed and perpetrated and their own fear of denouncing them. There is a video version here.

Coming less than a month before Rio’s Olympics begin, amid mounting concerns over rising crime and worsening security, the report is a sobering indictment of Rio’s police. But it also suggests practical solutions to improve things — some of which have already been begun to be implemented.

Killings by police in Brazil are well documented, but reports often concentrate on the victims. For this report, Human Rights Watch interviewed 34 officers, as well as prosecutors, investigators and the relatives of victims. The group analyzed autopsy reports and case notes for 64 cases of police killings, in which 116 people died. Only eight of these went to trial, and officers were convicted in only four. Evidence of summary executions was often ignored.

César Muñoz, the researcher who wrote the report, said he began by talking to police commanders to win the trust of police.

“They were surprised,” he said. “They have this idea that human rights organizations defend the bandits.”

His interviews reveal the temptations, pressures and organizational failings behind the Rio police department’s culture of violence and fear. Officers working in Rio face regular shootouts with heavily armed gangs and yet are offered very little psychological support. With prosecutors unwilling to take officers to court, and police investigators carrying out shoddy, incomplete investigations in which they frequently fail to even visit the crime scene, impunity is rife.

When Rio won its Olympic bid in 2009, expectations were very different. The year before, the state launched an ambitious program to the pacify poor, improvised communities called favelas, which had long been dominated by drug gangs. Armed police bases were installed along with community policing initiatives, and 38 favelas now have these bases.

For four years, violent crime fell across these favelas. But since 2013, it has been rising in these areas. Residents complain that they did not receive promised social improvements and that police have failed to control brutality.

For its report, Human Rights Watch interviewed four officers involved in corruption and violence, who spoke anonymously for their own protection.

One officer, identified by the pseudonym "Danilo," said he took part in operations to kill suspected drug traffickers and that some officers kidnapped gang members for ransom, then killed them anyway. He said others accepted bribes from drug traffickers to leave them alone — with his battalion earning $34,000 a week.

“Killing criminals was required as good performance by my superior,” he told the human rights group. Victims of police killings in favelas are frequently described as suspected gang members, claims that are often disputed by relatives.

Another officer, called "João," described torturing suspected gang members with beatings and a plastic ice bag tied over their heads to asphyxiate them.

João told the report's author he would never snitch on his fellow officers. “They would not think even a millisecond before killing me or my family,” he said.

In the Providencia favela, a resident filmed officers in September 2015 doctoring the crime scene after shooting 17-year-old Eduardo Victor, planting in his hand a gun they had just fired. This eroded trust in the police. “I feel people’s distrust and contempt,” one officer based there, identified as "Laura," was quoted as saying in the report.

Violent crime has risen in Rio state this year. Deaths due to police intervention soared 91 percent in May compared to a year ago. Many fear the favela pacification scheme is coming undone.

Human Rights Watch’s Americas director, Daniel Wilkinson, said Rio state’s failure to address impunity over police killings is a major factor in this.

“You can’t have effective community policing when you have some police executing members of the community,” Wilkinson said.

Muñoz said the state’s attorney general and prosecutors have failed to prosecute cases of police killings. From 2008 to 2011, a concerted effort to prosecute police over killings led to a 70 percent drop in such deaths in the nearby city of Sao Goncalo, before the judge leading the crusade was gunned down.

But researchers heralded new moves in Rio, where cases are now being investigated by centralized teams, rather than local police stations. A special unit of prosecutors has also been set up in the Attorney General’s Office. And in a pilot project, some officers have been wearing body cameras linked to their smartphones.

“This is not an impossible task,” Wilkinson said.

Despite promising to do so, Rio’s state public security secretariat has yet to comment.