On the afternoon of March 13, 2010, two teams of gunmen linked to a cartel lay in wait outside a private residence in Ciudad Juarez, observing the steady departure of guests from a child’s birthday party. Many of the guests were employees of the United States Consulate in Juarez who were attending with their families.

Though some details remain hazy, what is clear is that a Chihuahua state police officer named Jorge Alberto Salcido, whose wife was a Mexican citizen employed by the consulate, said his goodbyes in the driveway and left the party with his two children, ages 4 and 7. One team of gunmen pursued Salcido in a vehicle and opened fire. He was shot to death; his children were wounded but survived.

Ten minutes after the report of the shooting reached the Juarez police, a separate set of gunmen at the birthday party observed a pregnant U.S. consulate employee named Lesley Ann Enriquez climb behind the wheel of her white Toyota SUV and drive off toward her home in El Paso. Her husband, Arthur Redelfs, a detention officer at the El Paso County jail, was in the passenger seat. As the American couple neared the Juarez City Hall, the gunmen opened fire. It was broad daylight. Witnesses described the SUV, bearing Texas plates, drifting for several feet and crashing near the entrance to the Stanton Street Bridge that links Juarez to El Paso. Enriquez and Redelfs were killed. The couple’s infant daughter was in the back seat, and survived. Authorities were quick to identify the three homicides as coordinated assassinations, the first and only attack on U.S. diplomatic personnel in Juarez.

The brazen triple homicide made international news and spurred doubts that Mexico is capable of quelling the violence among drug-trafficking organizations in Juarez. The White House declared in a statement that President Obama was “deeply saddened and outraged” by the consulate murders. Secretary of State Hillary Clinton seized on the attacks to reaffirm U.S. policy of cooperating with the Mexican government “to cripple the influence of trafficking organizations at work in Mexico.”

Within 24 hours of the attacks, Chihuahua officials announced that initial evidence, corroborated by U.S. intelligence, indicated the assassins were members of Barrio Azteca, a street gang linked to the Juarez Cartel. Speculation was rife that the attacks were retaliation for U.S. involvement in the war between the Juarez and Sinaloa cartels over control of the lucrative drug corridor into El Paso. But much about the infamous killings—like so many details of the violence in Juarez—had, until recently, remained a mystery.

On Jan. 31, the man accused of orchestrating a slew of murders, including the 2010 assassinations of the three people linked to the U.S. Consulate, went on trial in U.S. District Court in El Paso. The trial pried open the secrets of the cartel war in Juarez that has claimed nearly 10,000 lives.

Arturo “Benny” Gallegos was the leader of Barrio Azteca, a gang formed in the 1980s among federal prisoners in Texas that grew into a dangerous criminal enterprise spanning the border cities of Juarez and El Paso. Barrio Azteca became an enforcement arm of the Juarez Cartel when the cartel was fighting for control of the El Paso corridor. In return, Barrio Azteca received discounted shipments of cocaine, heroin and marijuana, and rose in stature in the West Texas criminal underworld.

A former hitman from Barrio Azteca who reported to Benny Gallegos took the witness stand on Feb. 11 against his former boss. Jesus Ernesto Chavez Castillo, alias “The Camel,” was a lead enforcer for Barrio Azteca after the gang formed its alliance with the Juarez Cartel in 2008. The Camel was one of the most violent men in Juarez. He told the jury that in the first eight months of 2009, he killed 800 people, and after that he lost count. He said he often beheaded and dismembered the corpses to impress his boss. The idea was to create a crime scene gory enough that “it would be big news.”

He said the idea for coordinated assassinations against the U.S. Consulate employees arose from Barrio Azteca’s suspicion that someone in the consulate was helping the Sinaloa Cartel move drugs into El Paso. The Camel testified that street prices in Texas for drugs supplied by the Sinaloa Cartel were too low for Barrio Azteca to match. He and other leaders made inquiries but found no satisfactory explanation for how Sinaloa could sell its drugs so cheaply. They must have had friends in high places, he testified; someone in the consulate might have been providing visas for Sinaloa smugglers to enter the United States legally. A visa in hand makes it easier and less expensive for someone to smuggle drugs across the border. The money saved can then be passed on to the customer. Barrio Azteca and the Juarez Cartel were being priced out of the market.

The U.S. Attorney’s Office wasn’t eager to endorse the idea that the U.S. Consulate was aiding the Sinaloa Cartel. So the prosecutor in the case has gone to some effort to suggest the possibility that the assassinations were a case of mistaken identity. An FBI agent named Carlos Hernandez testified to a conversation with Gallegos in Mexico City in which the accused mastermind told him that the victims in the consulate murders were “not the intended targets.” Gallegos denied this. His lawyers filed a motion in November disavowing any statement he made to the FBI prior to his extradition to El Paso. He alleges that Mexican authorities, acting on behalf of the United States, tortured him into making false statements. He claims that he was beaten, hanged by his arms, electrocuted and forced to listen while his wife was raped in an adjacent room. The statements he gave to the FBI, the defense document reads, “were the product of torture at the hands of Mexican officials and improper psychological pressure by the F.B.I. agents.”

According to the mistaken-identity theory, the Juarez Cartel wanted to kill someone aligned with Sinaloa seen driving a white Honda Pilot. Benny Gallegos gave the order, and The Camel spread the word to his network of enforcers to be on the lookout. The SUV in question happened to be the same make, model and color as the one Salcido was driving the day he was shot. Enriquez and Redelfs drove a white Toyota RAV4, similar in appearance to a Honda Pilot, but with license plates from Texas, not Chihuahua. The Camel testified that not long after the assassins’ bullets had found their mark he overheard what sounded to him like frantic radio chatter between Gallegos and other leaders of Barrio Azteca. It seemed to him as though perhaps not all had gone according to plan.

What seemed indisputable, and the most damning evidence against Gallegos, were the recordings of hitmen for the Juarez Cartel discussing murders. On the recordings played for the jury, Gallegos’ voice could be heard ordering murder after murder, in some cases with a grisly flourish like a beheading, and all from the comfort of his quiet home in the Paseos del Bosque neighborhood of Juarez. But the question was, where did the recordings come from?

The answer came on Feb. 11, when the prosecution called to the stand a confidential informant for the Drug Enforcement Agency (DEA) known only by the initials EQ. El Diario de Juarez described him as a man wearing a toupee of long straight gray hair, a full beard of the same color, and black tortoise-shell eyeglasses with a weak prescription.

EQ is a telecommunications specialist from Mexico. He was contacted about setting up a communications network by an old friend of his named Jaime Bon Arreola, who took orders from Gallegos. EQ put together a telecommunications network for the Juarez Cartel that went live in May 2010. The idea behind it was simple. The cartel had two groups of enforcers. The first was La Linea, a shadowy network of city and state police officers who moonlighted as an elite guard of hitmen, in many cases committing the crimes they would later be called to investigate. The other was Barrio Azteca, a gang whose members served as rank-and-file soldiers in the war against the Sinaloa Cartel. EQ’s network was built for the two groups to communicate with each other beyond the detection of scanners.

EQ used state-of-the art radio technology more advanced than anything even the DEA had available to counter it. To ensure adequate range, he planted a network antenna on top of Cerro Bola, one of the highest peaks looking down on Juarez. He put 60 push-to-talk hand-held radios in the hands of cartel enforcers: 30 for Barrio Azteca, 30 for La Linea.

He began having reservations about what he’d done after the cartel targeted Mexican federal police with a car bomb on July 15, 2010. The bombers phoned in a false report that an officer had been shot, luring police and rescue workers to the intersection where a wounded man in a police uniform lay bound and gagged. Unbeknownst to the first responders on the scene, an old Pontiac parked against the curb held 22 pounds of an explosive water-gel called Tovex. Someone in the line of sight of the car bomb detonated it with a cell phone. Two federal police agents, one city police officer and a medical technician were killed, and nine civilians were wounded.

EQ recalled in court that Gallegos had given the order to go ahead with the car-bombing through a coded request for a subordinate to “go out and buy me some hot dogs.” Though various media reports at the time remarked on the unprecedented sophistication of the attack, EQ said that the bomb did not detonate as planned. If it had, many more federal police would have perished in the blast. The decision to turn informant, EQ said, came to him soon after the bombing. He sought protection first from the Office of the Attorney General in Mexico, and then from the Mexican army, but neither showed any interest. He said that the U.S. would have rebuffed him as well, had he not made up a convincing story about another car bomb that got him a meeting with the DEA. By the end of July, he had passed a lie-detector test and was put on the agency’s payroll.

From July to November 2010, EQ was a paid informant of the DEA. He managed to patch his U.S. handlers into the secure telecommunications network that the Juarez Cartel used to organize murders, abductions, drug shipments, arson and even bombings. Thanks to EQ, the DEA listened in on 80 assassination plots. In many cases, the bodies of victims were beheaded, dismembered, or incinerated. The agency listened in for four months, staying up on the wire and delaying the arrest of Benny Gallegos until Nov. 27, 2010, for his direct role in orchestrating all 80 murders.

EQ earned $125,000 from the DEA for providing the evidence that led to the arrest of his boss, Gallegos, and the temporary disruption of the radio network that he built. EQ confirmed in court what authorities had long suspected, that the car bomb was set in retaliation against elements of the Mexican federal police for not obeying the wishes of the Juarez Cartel. A warning addressed to the FBI and DEA had appeared at the time of the car bombing, scrawled in graffiti on the wall of an elementary school. It threatened more car bombs unless the U.S. put a stop to collusion between the Mexican federal authorities and the Sinaloa Cartel of Joaquin “El Chapo” Guzman. The widely published findings of an investigation by the Mexican daily newspaper El Universal showed that agents from the DEA, Immigration and Customs Enforcement, and the U.S. Attorney’s Office coordinated with top leaders of the Sinaloa Cartel to inflict damage on rivals like the Juarez Cartel.

EQ is now a protected witness living with his family in the United States. Meanwhile, Benny Gallegos was extradited to El Paso in June 2012. He was found guilty on Feb. 15 and faces a maximum sentence of life in prison. The Juarez Cartel that he served lost the war to the Sinaloa Cartel and ceded control of its home territory in 2011. Law enforcement authorities maintain that the cartel is still in operation in the state of Chihuahua, and parts of West Texas and southeastern New Mexico. Barrio Azteca also remains active, though its power has declined as hostilities against Sinaloa diminished.

Correction: The original version of this story misspelled the name of a victim of the March 13, 2010, assassinations in Juarez. His name was Arthur Redelfs. The Observer regrets the error.