UPPER MARLBORO, Md. (AP) — A former Prince George’s County sheriff’s deputy has pleaded guilty to having sex with an inmate in a holding cell at a courthouse.

Lamar McIntyre pleaded guilty Thursday to correctional officer sex with an inmate and one count of misconduct in office. As part of a plea deal, prosecutors agreed to ask for a term of no more than 18 months at sentencing on Jan. 16.

Authorities say in June 2012, the inmate was waiting in the county courthouse to see a judge when McIntyre took her into a holding area, where they had sex. The inmate reported the incident when she was returned to the detention facility.

(Copyright 2013 by The Associated Press. All Rights Reserved.)