By Lisa Redmond

MediaNews

WOBURN -- The 12-year-old Shirley girl revealed her secret in a letter, asking a friend to go with her when she met "Josh" to make sure she didn't have sex with him.

The letter ended up in the hands of the girl's school principal. The principal spoke to another student, who confirmed the underage girl was in a sexual relationship with an 18-year-old man she met online, said prosecutors.

The principal notified the police.

Joshua Bernier-Laing, of Manchester, N.H., was arrested in March 2012 when the girl's father intercepted a text message from him on his daughter's cellphone.

Bernier-Laing wrote that he was waiting for the girl at a local pizza shop. Shirley found Bernier-Laing waiting outside the pizza shop.

In Middlesex Superior Court last Thursday, Bernier-Laing pleaded guilty to statutory rape of a child and indecent assault and battery on a child under 14.

Judge Jane Haggerty sentenced Bernier-Laing, who had no criminal record, to two years in jail followed by three years probation. While on probation, he must have no contact with the victim or her family, no unsupervised contact with any child under 16 except for his child, who is about 4.

Bernier-Laing must also wear a GPS bracelet, undergo sex-offender treatment and register as a sex offender.

Prosecutors allege that when police spoke to the victim she admitted she and Bernier-Laing were involved in a sexual relationship. While she was not physically forced into sex, the girl told police "she felt pressured" into having sex with him, prosecutors said.