SANTA ANA (CBSLA.com) — A former Orange County sheriff’s deputy was cleared of two remaining charges against him after being accused of helping a convicted murderer’s wife have sex with her husband behind bars and smuggle contraband to the inmate.

David Lloyd Cass was acquitted in July of a bribery charge, but the jury in that case deadlocked on an additional bribery count and an accessory charge.

Despite prosecutors’ efforts to retry Cass on those remaining charges, Orange County Superior Court Judge Patrick Donahue dismissed those counts today, citing insufficient evidence.

Cass said he was “extremely relieved” at the decision. He also praised his attorney, Lew Rosenblum, saying he did a “phenomenal job.”

The jury deliberated for about two days in July before deadlocking 7-5 in favor of acquittal on a bribery count involving tickets to a Los Angeles Kings hockey game and a gift card, and 8-4 for acquittal on the charge of being an accessory after the fact.

Prosecutors say Cass gave co-defendant Ha Nguyen, who testified against him, a heads-up when authorities found drugs, a cell phone and other contraband in the cell of her husband, Stephenson Choi Kim, who is serving a life prison term without the possibility of parole.

Jurors cleared Cass of a bribery count involving allegations of seeking introductions to women and being given VIP treatment at coffee houses where waitresses are scantily clad. Rosenblum said after the trial that his client’s “acceptance of a gift may be a violation of policy, but it’s not a crime.”

Nguyen pleaded guilty to trying to help Kim escape from custody and also admitted to selling drugs to another inmate and bribing a law enforcement official. Rosenblum said Nguyen lied under oath to win a plea deal from prosecutors.

In his closing argument, Rosenblum said there were numerous inconsistencies in Nguyen’s testimony, compared to earlier statements under oath at a preliminary hearing and what she told investigators.

Rosenblum said Nguyen claimed that Cass turned out the lights in a jail waiting room so Kim could have sex with Nguyen, who had portrayed herself as a “legal runner” for the defendant. However, the lights were on in a video the couple made of their sexual encounter, Rosenblum said.

Cass merely thought Nguyen was being “nice” when she gave him gift cards, such as one for a day spa, according to his attorney.

Deputy District Attorney Aleta Bryant argued during the trial that Cass “was on trial for doing what no other deputy at the Orange County Jail did — not one. He is on trial here for turning out the lights so Stephenson Kim and his legal-runner/wife could have sexual relations.”

Cass also called Nguyen when a raid on Kim’s cell turned up a phone, drugs and other contraband, and warned her to “stay away,” Bryant told jurors.

The phone found in jail revealed calls between Kim and Nguyen, who had secretly married while he was in custody pending trial, Bryant said. After monitoring Nguyen’s visits to the jail and her phone records, investigators were led to Cass.

Kim and Nguyen had sex together in custody the first time around Thanksgiving 2009, and were allowed to do so again 15 to 30 times over the next two years, Bryant said. On 74 of Nguyen’s visits to the jail to see Kim, Cass was on duty 52 times, Bryant said.

Kim was convicted in March 2011 of a March 13, 2004, shooting spree at the 5th Wave Cafe that killed 21-year-old Venus Huyn and wounded four others. He opened fire in the cafe because he thought one of the victims had ties to a rival gang that had beaten him up, according to trial testimony.

(©2014 CBS Local Media, a division of CBS Radio Inc. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. Wire services contributed to this report.)