BOULDER, Colo. (AP) - A former Boulder police officer accused of stalking his ex-girlfriend and plotting to kill her new boyfriend has reached a plea deal, just before he was to stand trial.

The Daily Camera reports Christian McCracken pleaded guilty Monday to one count of felony stalking. He is due to be sentenced April 15. McCracken also pleaded guilty in an unrelated case to a misdemeanor drug possession charge and received a deferred sentence.

McCracken was arrested in the stalking case after his roommate said McCracken had talked of planning to kill the new boyfriend before committing suicide. At the time, McCracken was on medical leave after sustaining a head injury when a suspect assaulted him in 2011.

McCracken has resigned from the police department.