U.S. Border Patrol agents ride ATVs along the U.S.-Mexico border fence at the Imperial Sand Dunes on Nov. 17, near Felicity, Calif. (John Moore/Getty Images)

Noe Lopez needed a favor.

It was early December, and the U.S. Border Patrol agent working on the San Diego-Tijuana border asked a co-worker whether they could switch patrol areas for the day.

She would take whatever area Lopez was assigned, and he would spend the day in a desolate, isolated area known as “S— Bridge.”

Court documents don’t detail what Lopez told the woman to persuade her to switch, but he likely kept the real reason a secret: He was expecting a package.

On Dec. 6, Lopez got in his Border Patrol vehicle, headed out to the designated location and picked up a black backpack weighing six pounds, according to a criminal complaint filed in U.S. District Court in the Southern District of California.

The backpack traveled from Lopez’s Border Patrol vehicle to the back of his GMC Yukon to a strip mall in Chula Vista, Calif., court documents say. There, the FBI says, Lopez met with a man who paid the Border Patrol agent to become a drug smuggler.

The price: $500 a pound, or $3,000 — and the promise of future work.

Lopez handed over the backpack, and the men made plans for another drop the next day — more drugs and a bigger payday for Lopez.

Lopez pulled out his phone and showed the contact where seven kilograms of cocaine should be dropped the following day, court documents say. The place was nicknamed “Goat Canyon” by Border Patrol agents.

Before he left, Lopez said he would mark the area where the drugs should be dropped with a Coke bottle.

But days later, he would be in handcuffs, charged with attempted distribution of methamphetamine, attempted distribution of cocaine and receiving a bribe by a public official.

Lopez’s contact in the smuggling operation was working as a confidential informant for the FBI.

Lopez made his first court appearance Thursday. In all, court documents say, Lopez accepted $10,000 to smuggle what he thought were drugs, which turned out to be fake meth and cocaine.

On Tuesday, a judge will determine whether Lopez is eligible for bail while he awaits trial. It was unclear whether Lopez had hired an attorney.

A woman who identified herself as his ex-wife told Philadelphia NBC-affiliate WCAU that Lopez might have had money problems. Still, the allegations surprised her.

“Everyone has money issues. We live in San Diego, but I mean, nothing to this extreme for someone to risk their career,” she said.

Chief Patrol Agent Richard A. Barlow said in a statement that the Border Patrol is cooperating with investigating agencies.

“Border Patrol agents are held to the highest standards, and we remain committed to performing our duties for the American people in the most professional way,” he said.

Lopez became a Border Patrol agent a decade ago, as a massive hiring spree led to a spike in the number of agents charged with corruption, according to the Associated Press.

An independent task force examining the Border Patrol found that the agency’s system for disciplining corrupt agents and officers does little to deter criminal wrongdoing, according to the Los Angeles Times.

The “discipline system is broken, “the report concluded.

“Such corrupt officials can assist the (drug) cartels by providing intelligence and facilitating the movement of large amounts of contraband across our borders and into our country,” the Homeland Security Advisory Council’s final report on Border Patrol integrity concluded. “Indeed, corrupt CBP law enforcement personnel pose a national security threat.”

Lopez is the third federal agent arrested on corruption charges since September, according to the San Diego Union-Tribune.

In September, Customs and Border Protection Officer Jose Luis Cota, who ran a lane at the San Ysidro Port of Entry, was arrested after authorities say he continually let a woman smuggle unauthorized immigrants through his lane in exchange for cash bribes and sex, according to the newspaper.

And on Nov. 30, Tyrone Duren, a former Homeland Security Investigations agent, was arrested on suspicion of stealing drug money from traffickers and laundering the cash.

Read more:

This officer shot and paralyzed an unarmed man. For 11 minutes he didn’t tell anyone.

Her job was to help victims of identity theft. Instead, she used them to steal from the IRS.

‘I’m going to hit him’: Dash-cam video shows officers tried to run over man before shooting him 14 times

A white officer said she was shot by a black man. Then her story started to unravel.