ROCKLAND, Maine — A Rockport man will serve up to nine months in jail after admitting in court Wednesday afternoon that he sexually assaulted two young girls last year.

Mark W. Cayouette, 53, pleaded guilty in Knox County Superior Court to two counts of unlawful sexual contact.

Sentencing will be held in February, but under terms of an agreement announced in court, Cayouette will be sentenced to five years in jail with all but nine months suspended. That nine months is a cap that allows his defense attorney to argue for less jail time at the sentencing hearing.

Under the agreement, Cayouette also would be placed on probation for 12 years and be listed on the state’s sex offender registry for the rest of his life.

Assistant District Attorney Jeffrey Baroody said that a sibling of the two girls, who were both under 12 years old, told her mother about inappropriate contact between Cayouette and the victims.

Police were contacted, and Cayouette immediately confessed his crimes to the officer. Cayouette told the officer that it was tickling that had gotten out of control, and he admitted he did it for sexual pleasure. The Rockport man told police he was relieved they had caught him.

He was arrested July 19 and has since been free on bail.

Cayouette is being represented by attorney Eric “Rick” Morse of Rockland.