For more than six months, Miguel Flores lived a double life. In his day job, he was a narcotics investigator for the Hidalgo County Sheriff’s Department. But underneath his uniform, he secretly wore a wire for the Federal Bureau of Investigation as part of a probe into corruption at the highest levels of law enforcement along the border.

With four children to feed and clothe, Flores saw a solid middle-class future in law enforcement. He worked hard, and in 2011 earned a promotion from deputy patrol officer to narcotics investigator. “I was doing really good, taking down a lot of loads,” Flores said in an exclusive interview with the Observer. “I had good informants.”

Then one day in August 2012, Gerardo Duran and Sal Arguello—two members of the Panama Unit, a rogue narcotic task force led by Jonathan Treviño, the son of Sheriff Guadalupe “Lupe” Treviño— approached Flores with an offer he couldn’t refuse. “Duran told me ‘you seem to know a lot of people with good information,’” Flores said. “I told them I’d be happy to introduce them to some of my informants, so they could make some arrests.”

But, according to Flores, that wasn’t what Duran had in mind, replying, “We don’t arrest them. We take their shit.”

Duran started describing to Flores how the Panama Unit operated. The unit’s seven officers had been stealing drug loads. They also were escorting drug loads for dealers through Hidalgo County in marked police cars only to return later and rip off the same drug dealers who had paid them for the escorts. As the Observer reported in a March feature story, the Panama Unit had been brazenly ripping off drug dealers for at least three years, according to multiple law-enforcement sources and federal indictments.

Flores had heard the rumors about the Panama Unit being dirty. Jonathan Treviño, Flores said, acted as if he were invincible because he was the sheriff’s son. “I knew this wasn’t going to be good for me either way,” Flores said.

He was in a difficult position. If he began working with the Panama Unit, he knew he would either get killed or arrested someday. If he said no, he might suffer retaliation at the sheriff’s department for angering his boss’ son.

So Flores reluctantly agreed to help the Panama Unit. But before his career as a corrupt cop got started, he drove to the local office of the Drug Enforcement Agency and confessed to meeting with Panama Unit members and described what they were doing. The DEA handed Flores off to FBI agents, who asked if he’d be willing to wear a wire. “I told them I’d do it because these people were way out of control,” Flores told the Observer. “They needed to be stopped.” The FBI refused to comment on the case.

The Panama Unit’s actions were endangering honest law enforcement officers, he said. Word had rippled through the county that a prison gang affiliated with the Gulf Cartel had been authorized to shoot Hidalgo County deputies because too many drug loads had been stolen by crooked cops. “They didn’t know who was stealing the loads, only that they were with the sheriff’s department,” Flores learned through his informants in the drug world. “And they wanted to send a message to make it stop.” Flores suspected it was the Panama Unit officers. And now he was working closely with them trying to gain their trust all the while wearing a wire and taking covert video of their operations for the FBI.

After months of undercover work, a stroke of bad luck nearly cost him his cover. To win Jonathan’s trust, Flores set up a meeting between two members of the Panama Unit and an informant that Flores knew. But Sal Arguello, one of the unit members and a sheriff’s deputy, recognized the informant. Flores didn’t realize it but his informant, a local dealer, had been ripped off a year earlier by the Panama Unit. “Sal went and told Jonathan and he thought I was trying to set them up.”

Flores’ troubles started soon after. On November 26, 2012, the sheriff’s internal affairs office notified Flores that he was under investigation. That could mean demotion or termination. The sheriff’s internal affair’s investigator told Flores that a reliable source had come forward accusing him of being the mastermind behind home invasions to steal money and drugs. In the official internal affairs report it states that Flores “attempted to persuade other law enforcement officers to participate in your plan to take and split the money.” Flores figured the Panama Unit was trying to set him up as a fall guy.

An internal affairs investigator questioned Flores for five hours. “They were pushing me to resign,” Flores said, but he refused. Two weeks later, three members of the Panama Unit, including Jonathan Treviño and Alexis Espinoza, the son of Hidalgo Police Chief Rudy Espinoza, were indicted by a federal grand jury after an investigation by Immigration and Customs Enforcement and the FBI. Flores’ covert audio and video helped bring down the allegedly corrupt narcotics task force. A few weeks later, the rest of the Panama Unit members, all deputies for the sheriff’s department, were also indicted: Eric Alcantar, Salvador Arguello, Claudio Mata, Fabian Rodriguez and Gerardo Duran. The sheriff’s son Jonathan Treviño was placed under house arrest at his father’s home in McAllen where he has lived for the past four years. And Alexis Espinoza is also awaiting trial at home.

Since the December indictment of the seven members associated with the unit, three local drug dealers have also been indicted for working with the allegedly corrupt cops. A former sergeant who headed the sheriff’s Crime Stoppers program before retiring in December has also been indicted along with recently retired deputy Jorge Garza.

But instead of feeling relief, Flores said that he’s fighting for his job and that his life is in tatters. After the November internal affairs investigation, he was demoted from a narcotics investigator to deputy patrol receiving less pay. Now he said he’s being investigated by internal affairs again for “continuous violations of policy.” Internal affairs is also investigating Flores for a police report of a domestic dispute with his wife that he said stemmed from the overwhelming stress he’s been under working as an informant. “I don’t sleep nights anymore. Thirteen years of marriage gone to hell over this because of the stress,” he said. “I know the sheriff wants to terminate me because I’m the one who brought down his son.”

Sheriff Lupe Treviño denied the accusations. “Him being an informant—that’s news to me,” he said. The sheriff said Flores’ move from narcotics investigator to patrol was not a demotion but a “lateral transfer.” Treviño said it was his prerogative as sheriff to move Flores to another position. “I’m the elected sheriff, and I can assign anywhere I want any time I want.” The sheriff said the current internal affairs investigation stems from Flores’ recent domestic dispute call made to the Mission Police Department. “It’s a personnel issue,” he said.

But Flores believes he’s being set up for termination because of his work as an informant. “I know [the sheriff] hates me for what I did,” he said. On Tuesday, Flores filed a whistleblower lawsuit against the sheriff’s department, alleging retaliation for serving as an FBI informant. In the lawsuit, he also alleges that the sheriff’s office did nothing to prevent the alleged corruption in the Panama Unit and that this ultimately forced Flores into an untenable situation. He is suing for back pay, mental anguish and loss of benefits.

Eight other former employees of the sheriff’s department, including Gerardo Vela, who was featured in the Observer’s March story also filed a civil lawsuit Tuesday. The lawsuit alleges that they were terminated in retaliation for refusing to work on the sheriff’s campaign for re-election or for supporting the sheriff’s opponent. And in a separate lawsuit also filed Tuesday, Jose Perez and his wife accused the sheriff and the City of Mission of “failing to intercede and curtail” the illegal activities of the Panama Unit. They are suing for mental anguish. Sheriff Treviño said he couldn’t comment on the lawsuits because they’re pending.

Flores said he feels like he did the right thing working as an informant but that it ruined his life. “I feel like I have no other choice but to speak out,” he said of his interview with the Observer. “I have to protect myself and my reputation because I know the sheriff has it in for me. I did the right thing, but it cost me a lot.”