A 33-year-old Lancaster man pleaded guilty Thursday in Lancaster County Court to breaking into a city home and masturbating in the presence of sleeping residents .

Ronald Vertis McKinney was sentenced to spend five to 10 years in state prison for the incident on Aug. 16 on the 700 block of West Vine Street in Lancaster.

McKinney broke into a rear bathroom window of the home and went through the apartment while masturbating, according to a news release from the Lancaster County district attorney's office.

The home's occupants -- a man, woman and two young children -- awoke while McKinney was in the residence. He fled but was later identified from a group of police photographs, officials said.

McKinney pleaded guilty to burglary, indecent exposure and open lewdness. He is also prohibited from having any contact with the victims and must comply with sex offender regulations.