Knowing that he was already in the sights of United States investigators, Mr. Rivera sought to help the Drug Enforcement Administration root out corrupt Honduran politicians and other elites who had made Honduras a gateway for massive amounts of cocaine headed for the United States through Mexico.

Image Devis Leonel Rivera Maradiaga, left, and Javier Eriberto Rivera Maradiaga. The brothers led a drug trafficking organization called Los Cachiros that was said to be responsible for dozens of murders. Credit... Department of the Treasury Office of Foreign Assets Control

The offer came at a time when United States officials were deeply concerned by Honduras’s slide into anarchy. A stalwart ally and home to a United States military base, Honduras was plagued by drug traffickers and gangs and had one of the world’s highest homicide rates. It is the first landing point for about 80 percent of suspected drug flights departing from South America, the State Department has said.

But to sign Mr. Rivera to a formal cooperation agreement meant the government would most likely have to do something for him: seek leniency on his behalf, which could spare him a long prison sentence and leave the families of the Honduran victims believing that Mr. Rivera got away with murder.

Today, four years after Mr. Rivera’s clandestine cooperation began, federal prosecutors in Manhattan have with his help charged seven police officers from Honduras’s national force, along with the son of the country’s former president and several members of a prominent Honduran banking family.

The evidence, a prosecutor said at a hearing on Sept. 5, showed nothing short of “state-sponsored drug trafficking.”