SACRAMENTO -

A former Anderson police officer accused of raping a woman who was in his custody in May 2010 has taken another plea deal, this time in federal court.

Bryan Benson, 29, pleaded guilty to one count of depriving the woman of her constitutional rights under color of authority in exchange for five years in prison.

He will formally be sentenced on August 15, and will remain on home detention with electronic monitoring until that time.

Benson was set to go to trial in early June, and could have faced life in prison if convicted.

The federal case began in December 2012, after Benson was indicted by a grand jury.

He was out of jail and on probation at the time, after serving a one-year sentence under a much-maligned plea deal with Shasta County prosecutors. In September of 2011, he pleaded no contest to felony assault by a public official and a misdemeanor charge of soliciting a lewd act. Prosecutors agreed to the deal because of a belief they could not convict Benson on more serious charges, due to a loophole in the law relating to how and when someone is considered “in custody.”

Benson was originally charged with seven felonies, including rape, kidnapping, sexual battery, bribery and assault.

Defense attorneys have long maintained the sexual contact between Benson and the woman was consensual.