A former Rockaway Township police officer who admitted to having sex with two teenage girls while on duty has been sentenced to six years in state prison, the Morris County Prosecutor's Office announced Friday.

Wilfredo Guzman, 45, of Rockaway Township, had previously pleaded guilty to two counts of official misconduct in May.

The assaults occurred in 2014 and 2015 in his patrol car, at a motel and at a police substation at the Rockaway Townsquare mall. Authorities have previously one girl was between 16 and 17 at the time, while the other was 15.

Guzman had been employed with the Rockaway Township Police Department for 14 years at the time of his arrest in 2017.

He will now serve a minimum of 5 years in state prison before he is eligible for parole. Guzman must also participate in mental health counseling, pay mandatory fines and penalties and is to have no contact with the victims.

Guzman was also required to forfeit his position as a law enforcement officer and is prohibited from obtaining public employment in the future.

"The public should, and does, expect the highest level of ethical and honorable behavior of Law Enforcement Officers. The reprehensible actions of this defendant should not tarnish the image of the thousands of honest sworn officers in Morris County," Morris County Prosecutor Fredric M. Knapp said in a statement.

Olivia Rizzo may be reached at orizzo@njadvancemedia.com. Follow her on Twitter @LivRizz. Find NJ.com on Facebook.

Have a tip? Tell us. nj.com/tips