High-ranking US customs agents violated a treaty with Mexico by approving a covert drug-smuggling probe that took a disastrous turn — funneling at least $100,000 to Mexican dealers while getting an informant killed, The Post has learned.

An alleged coverup of the busted operation allowed two officials to score plum promotions, but emails obtained by The Post show that the rogue operation is being investigated by the State Department and two congressional committees.

Officials from the State Department Inspector General’s Office recently interviewed several agents with Immigration and Customs Enforcement about the allegations, and “they’re moving pretty quickly,” said a source familiar with the matter.

Meanwhile, the Mexican government remains completely in the dark about the affair, the source said.

“It’s an unprecedented rogue operation in a foreign country,” the source said.

“You have so many points at which this activity should have been curtailed, and you just wonder who in leadership is actually watching what’s going on.”

The undercover operation was run out of the ICE office in San Diego, according to an email dossier compiled by a whistle-blower, who sparked the government investigations. The whistle-blower is one of several current and former agents with knowledge of the botched probe.

The ICE agents recruited a Mexican national, Isaias Borquez Lizarraga, 39, as an informant. He pretended to smuggle drugs into the United States so the “proceeds” could be traced back to traffickers in Mexico, a source said.

But the operation was conducted without approval from the Mexican government, a move that violated the 1999 Brownsville-Merida Agreement, which governs American law enforcement activity south of the border, the whistle-blower reported.

Lizarraga’s cover was blown, and he was among three people found shot to death, execution-style, on March 28, 2014, inside a dental lab in the Mexican border town of Los Algodones, just west of Yuma, Ariz.

Even after Lizarraga’s murder, ICE agents in San Diego used another informant to make a series of wire transfers totaling at least $100,000 to Mexican bank accounts controlled by the drug supplier, according to the dossier.

None of that money has been recovered, the whistle-blower wrote.

“It is unknown as of now the illegal activities that US government funds have financed in Mexico, or elsewhere, as a result of these wire transfers,” the whistle-blower wrote in the memo sent to the State Department IG and the House and Senate committees.

“This is a serious series of violations that’s probably going to have ramifications for other US agencies that want to operate in Mexico,” the source said.

“It’s a serious breach of trust.”

According to the whistle-blower’s report, Derek Benner, the special agent in charge of the San Diego ICE office at the time, and Nick Annan, who was his deputy, “directed and sanctioned” the operation that resulted in Lizarraga’s death and the loss of the taxpayer cash.

ICE agents stationed in both San Diego and Mexico have been questioned by State Department investigators, and “there’s at least one person who said they were in a meeting with Benner and Annan,” according to a source.

The agents were also required to sign confidentiality agreements and “told not to inform their chain of command,” the source added.

The whistle-blower’s email notes that neither the alleged treaty violation, Lizarraga’s murder nor the missing money had been reported to ICE higher-ups.

Meanwhile, several ICE officials involved in the screw-up got promoted, with Benner transferred to ICE headquarters in Washington, DC, where he now holds the title of deputy executive associate director of Homeland Security Investigations.

That job makes him No. 2 in charge of more than 10,000 employees around the world.

Annan was named special agent in charge of ICE’s Homeland Security Investigations office in Atlanta, which oversees operations in three states and is “one of the most productive offices in the country,” according to ICE.

The botched smuggling probe echoes the Fast and Furious scandal, in which a sting operation by the Bureau of Alcohol, Tobacco, Firearms and Explosives lost track of hundreds of weapons that the feds hoped to trace to high-level Mexican drug dealers.

It’s unclear which drug dealers were targeted by the ICE operation. According to a 2013 congressional report, there were two “national” narcotics cartels and as many as 80 smaller groups in Mexico.

In July, captured Sinaloa cartel kingpin Joaquin “El Chapo” Guzman staged a spectacular prison break, disappearing through a mile-long underground tunnel outfitted with tracks for a rail-riding motorcycle.

The Department of Homeland Security has estimated that 90 percent of all the cocaine consumed in the United States arrives via Mexico, with traffickers there raking in between $19 billion and $29 billion a year.

The drug trade has been blamed for up to half of Mexico’s 15,000-plus murders last year.

A spokesman for the State Department IG would neither confirm nor deny an investigation.

Emails obtained by The Post show the Senate Homeland Security and House Oversight committees also launched probes. Spokeswomen for those committees declined to comment.

But Tristan Leavitt, a lawyer for the House committee, said in an email: “I wanted to update you that we contacted the State OIG, and they confirmed that they have an open case, although they wouldn’t share much other than the fact that it involves more than just the State OIG.”

Neither Benner nor Annan returned calls and emails seeking comment.

In a statement, ICE said it “has no knowledge of an investigation being conducted by the State Department or Congress into the agency’s investigations along the US/Mexico border.”