SALEM, Mass. — A Maine resident has been sentenced to four years in prison after pleading guilty to sexually assaulting a Massachusetts girl over several years starting when she was 8 years old.

Jonathan Hare of Buckfield, Maine, was sentenced Tuesday after pleading guilty to child rape and seven counts of indecent assault and battery on a child.

Prosecutors say the abuse occurred when the girl was living with her mother in apartments in Salem, Beverly, Marblehead and Gloucester. Prosecutors say the 31-year-old Hare, who at one point lived with the girl and her mother, would sneak into her room at night and molest her, warning her not to tell anyone or he’d kill her.

The Salem News reports that Hare’s lawyer said her client wanted to accept responsibility for his actions.