SANTA ANA – A judge dismissed all remaining charges Friday against a former Orange County sheriff’s deputy who was accused of taking bribes to let an inmate have sex and sneak contraband into jail.

David Cass, 40, thanked the judge for the ruling and said later he was “extremely relieved.” Surrounded by supporters, he hugged his attorney outside the courtroom.

“He needs to rebuild his life,” said Cass’ attorney, Lewis Rosenblum. “This has been going on now for 2½ years.”

In July, a jury acquitted Cass of one count of bribery, but split on two other counts. Seven of 12 jurors wanted to acquit him of a second bribery count, and eight wanted to acquit him of being an accessory after the fact to drug smuggling.

The prosecutor wanted to retry the case. But Superior Court Judge Patrick Donahue, who oversaw the trial, said Friday he had concluded “no reasonable trier of fact could find guilt beyond a reasonable doubt.”

After a yearlong investigation, prosecutors charged Cass last year with taking bribes from Ha Nguyen, the girlfriend and later wife of murder suspect Stephenson Kim. A prosecutor told jurors Cass turned off the lights in a jail visiting booth and let the two have sex dozens of times between 2009 and 2011.

Nguyen testified she also snuck in homemade and takeout meals that the couple shared in jail, including steak, shrimp, pasta and fast food. She brought Kim other snacks for him to take back to his cell: candy, gum, Slim Jims, tuna and peanut butter. The two recorded videos of some sexual encounters with a cell phone and watched pornography on Nguyen’s laptop.

Deputy District Attorney Aleta Bryant said she was surprised and disappointed with the judge’s decision.

“I still believe in the people’s case … and was ready to prosecute it again,” she said after the hearing, adding later, “I don’t believe justice was done in this case based on this ruling.”

Bryant said there was enough evidence on both charges to let a second jury rule on them.

Rosenblum told jurors the deputy’s actions were “stupid” but not criminal. Cass did favors for Nguyen because she was nice – not making her wait long before bringing Kim down for visits, for example, the lawyer said.

Cass foolishly accepted L.A. Kings tickets and a spa gift card from her in violation of Sheriff’s Department policy, Rosenblum said, but thought of them as simple thank-yous – not bribes.

Several jurors said they agreed with Rosenblum that Cass broke department rules, but didn’t commit crimes. Rosenblun called the story of Cass turning the lights out a fabrication by Nguyen, an admitted liar.

Evidence showed Nguyen was able to sneak in food and drugs in a box because she was a court-authorized “legal runner” on Kim’s case. Legal runners, like attorneys, aren’t searched before visiting inmates, deputies testified.

“You might as well indict the whole Sheriff’s Department for letting all this stuff in,” Rosenblum told the jury.

Rosenblum argued Cass and other deputies didn’t know Kim and Nguyen were a couple and were duped by a “sociopathic” murderer and his girlfriend. The two got a court-sanctioned “confidential” marriage, meaning their union was not public record.

Kim, 34, who did not testify in Cass’ trial, is serving a life prison term for opening fire inside a Cypress cafe in 2004 because he thought rival gang members were there. He killed an innocent woman and injured several other people.

Under oath, Nguyen admitted she tried to hide her relationship with Kim from deputies. She also testified Cass never sought a bribe and didn’t know anything about the drugs.

Nguyen said she never wanted to get Cass in trouble and gave him hockey tickets and gift cards to restaurants and a spa to “thank” him.

Cass, who resigned from the Sheriff’s Department, now owns a mobile screen business and has struggled to make a living with felony charges hanging over his head, his lawyer said Friday.

“I’m sorry that my client had to go through all of this,” Rosenblum said. “But on the other hand, I’m gratified that we’ve got (judges who are) willing to make the tough calls in a case that should not be prosecuted.”

Contact the writer: ehartley@ocregister.com or 949-229-5950