WILKES-BARRE — Former Wyoming part-time police officer Cody Lee Smith will have to register his address for 25 years under the state’s Megan’s Law when he is finished completing a two-to-four-year state prison sentence for having sexual relations with three girls.

Luzerne County Judge Tina Polachek Gartley on Friday reluctantly stayed with a plea agreement reached between prosecutors and Smith’s lawyers that called for the sentence imposed on Thursday.

Smith, 22, of Wyoming Avenue, Wyoming, pleaded guilty in March to two counts of statutory sexual assault and one count each of unlawful contact with a minor and corruption of minors. Polachek Gartley also ordered Smith to serve five years probation when he is released from prison.

Polachek Gartley advised Smith if it wasn’t for the plea deal, his sentence “would have been different.”

Assistant District Attorney Jenny Roberts said the plea agreement prevented the girls from embarrassment from having to testify and recalling sexual encounters with Smith.

“He certainly accepted responsibility,” said attorney Jonathan Blum, who represented Smith with attorney Ferris Webby. “He knows his conduct has hurt the victims. He knows his conduct has hurt his family.”

Webby said the “whole thing started” when Smith, as a police officer, provided aid to one of the girls.

Smith said he knows he ruined his life and made a terrible mistake.

“I struggled with this case because there was an agreement to sentence,” Polachek Gartley said, confirming with Roberts that the girls and their parents also agreed to the plea deal and sentence.

None of the girls or their parents appeared for Smith’s sentencing hearing.

Roberts said Smith was not found to be a sexual violent predator by the state’s Sexual Assessment Offender Board, which would have required him to register his address with state police for the rest of his life.

State police Bureau of Criminal Investigations charged Smith in four separate criminal complaints in October and November on allegations he had sexual encounters with two 14-year-old girls and a 16-year-old girl, and provided alcohol to juveniles at house parties from July 2012 to August 2013.

Two of the girls claimed Smith told them that he was in a gang. He told the 16-year-old girl he couldn’t see her anymore when he turned 21, the complaints say.

Polachek Gartley said she received 14 character letters that indicated Smith has “good moral character,” “wanted to be a police officer his whole life,” and is a “trusting young man.”

“These letters, not one speaks to the crimes he committed,” Polachek Gartley said.