A Kern County jury acquitted a defendant of rape and other charges Thursday.

Michael William Hunter, 47, was scheduled to be released from custody, according to the Kern County Sheriff's Department website.

Hunter faced up to 40 years in prison if convicted, according to a news release from the Kern County Public Defender's office. In addition to the rape charge, he was also acquitted of three other felony sex charges.

Hunter was represented by Deputy Public Defender Paul Cadman, and the case was prosecuted by Deputy District Attorney Arthur Norris.