A former Prince George’s County police officer pleaded guilty to second-degree assault Wednesday for taking sexually explicit photos of an unconscious woman while he was off duty, authorities said.

A judge sentenced 30-year-old Christopher Adams to three years of supervised probation and 150 hours of community service after he entered his plea, according to the Prince George’s County state’s attorney’s office.

The incident dates back to March 2013, when Adams, his wife and his wife’s friend shared a hotel room after a birthday celebration, authorities said. When Adams returned to the room, he saw the victim passed out on the bathroom floor and snapped photos of her on his phone without her consent, prosecutors alleged.

Prince George’s police suspended Adams after learning of the allegations and launching an internal investigation. The department then presented the case to state prosecutors, leading to the criminal charges.

Adams, who worked for the department for seven years, resigned from the task force last month, police said.

“The community’s trust is paramount in our crime-fighting efforts,” Chief Mark Magaw said of the incident. “Anyone who violates that trust will be held accountable.”

Get updates on your area delivered via e-mail.