ROCKLAND, Maine — A 32-year-old South Thomaston man was sentenced Tuesday for assaulting a woman while awaiting sentencing on a 2012 home invasion.

David Earl was sentenced in Knox County Superior Court by Justice Jeffrey Hjelm to 18 months in jail with all but 30 days suspended for aggravated criminal trespass and assault for an incident in May 2012 at a home in South Thomaston. He will also be placed on probation for two years upon his release.

In that case, Earl kicked in the door of a house and assaulted the man who lived there.

Earl had reached a deal with the prosecution and court in November in which the felony aggravated criminal trespass charge would be lowered to a misdemeanor, and he would serve no more than seven days in jail if he refrained from criminal conduct for the following year.

But Earl was charged in June 2013 with unlawful sexual touching, assault and violating a condition of release. That charge stems from an incident that occurred May 29 when he went to the home of a woman, knocked on her door, and then accosted her when she opened the door.

The affidavit filed by the Knox County Sheriff’s Office in Rockland District Court stated that he kissed the woman’s arm, then grabbed her rear. The woman managed to get the door closed and then called police. She said she had met Earl the previous day when she was walking by his home, and he made a comment about her rear.

Earl was also fined $600 and ordered to pay restitution of $1,006 to the homeowner in South Thomaston. In that earlier case, the prosecution said it agreed to the deferred disposition and the seven-day jail term because the victim and Earl had a history of disputes and there may have been proof problems with the case. The defense had argued that Earl went to the victim’s home after the victim had gone to Earl’s mother’s home and made inappropriate comments.