MARLBORO, MASS. (WHDH) - A 35-year-old man accused of attacking a woman on a Marlboro trail Monday faced a judge Tuesday after his friend of 20 years turned him into police.

Jonathan Parker was arraigned in court on charges of assault to rape as well as assault and battery after he allegedly attacked woman and tried to forcefully pull off her pants while she was walking on the Assabet River Rail Trail near the intersection of Fitchburg Street and Sasseville Way around 6:20 a.m., according to police.

The victim was able to break free from him and recorded her attacker on video as he fled the area in the opposite direction, police added. They say she suffered minor injuries to her mouth and leg.

Erin Balthazar, who says she has been friends with Parker for two decades, contacted police shortly after the incident and assisted them in identifying him as a suspect.

It was the photos that police were able to pull from a nearby business and post on Facebook that caught her attention.

“I didn’t even question it. I knew it was the right thing to do. It doesn’t matter if they’re your friend or family, You got to do the right thing,” she said.

Police said Parker tried to change his appearance before being arrested by shaving off his long beard.

“The complaining witness did indicate to the police ‘that’s him’ when they followed up in respect to identification,” prosecutor Ben Woolf said in court.

Parker’s defense attorney Ryan Sullivan questioned the validity of the identification. “Is she saying, ‘yes that’s Jonathan Parker’ because the identifying information out there in the public,” he asked?

Parker is being held and will be back in court at the end of the week. Balthazar said she hopes the victim feels safer now.

“I’m just glad she knows that he’s behind bars and that he’s off the streets and hopefully it doesn’t happen to anybody else,” she said.

(Copyright (c) 2021 Sunbeam Television. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)

Join our Newsletter for the latest news right to your inbox