The deputy knew he was breaking the rules, but he obliged. What started with hamburgers and pizza led steadily to more requests until the inmate asked Felix to perform another favor: smuggle in a marijuana package in exchange for about $600.

That delivery into the Castaic jail would be the first in a months-long series of drug carries the deputy made, netting thousands of dollars in the process. Inmates goaded Felix to bring them more, telling the young deputy that he wasn't the only officer smuggling drugs and that they respected him because he was from the "hood."

The case underscores the Sheriff's Department's struggles to keep drugs out of the nation's largest county jail system. Deputies confiscate drugs from inmates on a regular basis -- and have done so for years. But Felix's crime and other recent cases reviewed by The Times offer a window into the elaborate schemes used to breach jailhouse security for major profit.

Earlier this year, Deputy Devin McLean admitted in an interview with a sheriff's investigator that she had smuggled heroin hidden in a toothpaste container into jail, according to a district attorney's office memo.

McLean said she was given the drugs by her then-boyfriend, a former inmate she had met while working at the North County Correctional Facility in Castaic. McLean explained that she carried the drugs into the jail in her backpack and then delivered the heroin inside a bedroll to an inmate, the memo stated.

Prosecutors declined to file criminal charges against McLean, saying that they did not have enough evidence to corroborate her statement at a trial. She has been relieved of duty with pay pending the outcome of an internal investigation. Her attorney declined comment.

In March, a federal grand jury indicted an employee of a private company that delivers food to the jails for allegedly smuggling more than 100 grams of heroin into the North County Correctional Facility. That amount would easily get 150 users high, one expert said.

Angelica Mora, 40, was allegedly part of a drug ring whose members communicated in code using jail telephones. Another defendant, the operation's drug supplier, also oversaw other criminal activities for a Los Angeles street gang and the Mexican Mafia, a notorious prison gang, according to court records. Mora, the supplier and several other defendants accused in the scheme have pleaded not guilty.

In June, a Beverly Hills attorney was charged with trying to smuggle heroin to inmates in a courthouse lockup.

A drug-sniffing sheriff's dog discovered a bag containing 14.25 grams of the narcotic, enough for 20 or more hits, in an area of the downtown L.A. courthouse where only the attorney, Michael Inman, 48, was waiting, authorities said. He has pleaded not guilty.

Sheriff's records show a steady increase in drug seizures across jail facilities over the last several years, with 370 last year compared to 270 in 2006.

"This is just what we know. How much is going on that we don't know about?" said Lt. Greg Thompson of the department's custody investigative services unit. "But we think we have a handle on it."

He said some drug-runners have stuffed narcotics into tennis balls and flung them over walls at the Twin Towers Correctional Facility.

"People have nothing to do but think here," he said. "And they're pretty imaginative."

Sheriff Lee Baca said depression and anxiety among inmates create a huge demand for drugs.

"People incarcerated are looking for some form of psychological support," Baca said. "Drugs seem to do that for most people who are addicted."

Despite the busts, drugs make their way in, sometimes with lethal consequences.

On Christmas Day last year, a 22-year-old murder suspect was found in distress in his cell at Men's Central Jail and began spitting up blood. Another inmate told authorities that Marlon Martinez had snorted an entire spoonful of brown liquid believed to be heroin, according to a coroner's report. The Mexican national was allegedly holding the heroin for one or more other inmates.

Martinez died soon after paramedics attempted to revive him.

Felix's defense attorney, Spencer R. Vodnoy, said his client knew little about the drug operation he was aiding, including who was behind it. Felix, he said, believed that he was transporting marijuana and had no idea that the deliveries included heroin.

The lawyer said Felix was unwittingly drawn in by the inmates when he agreed to give them unauthorized food.

"He wanted to be liked, he wanted to please people," Vodnoy said. "That's a nice thing in most people, but in a sheriff's deputy that was a huge personality flaw."

Felix initially refused requests to transport drugs, his attorney said. But he feared that the inmates might tell jail managers what he had already done and that he would lose his job, Vodnoy said. And though he was never directly threatened, the deputy began to fear for his family's safety after inmates told him that they recognized him from his days playing baseball growing up in Baldwin Park, Vodnoy said.

Felix also benefited financially from his role as drug courier.

He told sheriff's investigators that he was paid $600 or $700 for his first delivery of marijuana and that he smuggled drugs into the jails on three other occasions, according to a probation report in the case. He was paid $2,000 to bring one package, and another job brought him $4,000, the probation report said.

"It seemed like a quick buck in the beginning, and then they kind of started asking for more," Felix told investigators, according to the report. "I really didn't want to. The first time it was OK, I guess, but after, they kept egging me on."

To those involved in the sophisticated scheme, Felix was a crucial cog known by the code name "Jackie O."

His "handler," according to records, was inmate Terance Warner, an aspiring Mexican Mafia affiliate with a history of selling drugs behind bars. In telephone exchanges monitored by investigators, Warner directed several women on the outside to get drugs into the jail through Felix, prosecutors alleged.

Some of the monitored communications were later shown to include phone conversations between the women and associates of the Mexican Mafia.

From inside jail, Warner allegedly directed his wife, Latisha Nichole Rubalcaba, to collect several thousand dollars from inmate accounts that are set up by the Sheriff's Department. The accounts are generally used by relatives of inmates to give loved ones money to buy snacks, phone cards and other cheap items at jailhouse concession stores.

But in one three-month period in 2008, more than $38,000 was withdrawn from Warner's account, court records say. It is not clear if all of that money came from drug sales.

Inmates are not allowed to carry cash, but officials said payments for drugs are sometimes made through intermediaries depositing cash into the accounts of jailhouse dealers.

Prosecutors accused Warner, 28, of directing another woman, Monique Ciara Garcia, to drop off drugs to Felix in a Baldwin Park parking lot in October 2008.

Garcia was carrying more than 161 grams of heroin, almost 25 grams of meth and roughly 50 grams of marijuana, enough to fill a large sandwich bag, when she met Felix. She also brought $5,100 in cash as payment for the deputy.

The narcotics were intended to be smuggled inside the jail where Felix worked, according to a felony complaint.

The drugs were particularly valuable in jail, where prices are dramatically higher than outside, according to court records in the federal case against the food supply company employee. Based on a federal agent's estimate in that case, Felix's delivery would have been worth well over $75,000 behind bars.

The deputy was driving away with the cache of drugs -- and his kickback -- when authorities stopped him.

He resigned from the department shortly after the arrest. He had been on the job for about two years.

Last week, Felix was led from a Los Angeles courtroom in handcuffs after a judge sentenced the former deputy to four years in prison. Warner, Rubalcaba, Garcia and another accomplice were sentenced to two years in prison.

Sheriff's officials say new rules prevent inmates from making large money transfers like Warner's. The department now caps accounts at $900, and limits transfers to third parties to $300 a week.

Felix's attorney suggested that the department begin random searches of jail deputies for drugs and other contraband to deter similar misconduct.

"These guys are master manipulators," Vodnoy said of some inmates. "Unfortunately for my client, they got the right guy -- a guy who might be susceptible."