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

The San Francisco Chronicle reports the judge also gave Sean Harrington six months in jail Tuesday, but she suspended the sentence as long as Harrington attends violence-prevention training and obeys the law while on probation.

READ MORE: Kings Place Adrian Kempe In COVID-19 Protocols

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.

READ MORE: Pedestrian Found Dead On Roadway In El Monte

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.

MORE NEWS: Missing Diver's Body Recovered After Hours-Long Search

(© Copyright 2015 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)