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: Childcare Crisis: Pandemic Closures Cause Economic Ripple Effect

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: Teenager Struck By Vehicle In Seal Beach

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: Pasadena, Long Beach Enact Eased Yellow Tier Rules Including Reopening Of Indoor Bars; LA County To Follow Thursday

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