A former California Highway Patrol officer has been sentenced to three years' probation for sharing explicit photos from the cellphones of two women while they were under arrest.

The San Francisco Chronicle reports (http://bit.ly/1z7brao ) the judge also gave Sean Harrington six months in jail Tuesday, but she suspended the sentence as long as Harrington attends a violence prevention training program and obeys the law while on probation.

The allegations surfaced after a 23-year-old woman discovered nude photos of herself had been sent from her phone to an unfamiliar number. A 19-year-old woman arrested in a Livermore drunken driving crash also accused Harrington of stealing photos from her phone.

Harrington resigned two days before charges were filed.

Outside court, the 35-year-old apologized to his family and friends, the two women involved, and police officers everywhere.