PORTLAND, Maine — A private investigator hired by a defense attorney for Eric Gwaro, a Scarborough man on trial for allegedly punching and stomping a Portland woman last year, told jurors on Thursday that key witnesses presented by the prosecution told him they “didn’t want to help that guy.”

Investigator Joseph T. Thornton was hired by attorney Daniel Lilley in his defense of Gwaro, 28, who faces charges of Class A attempted murder, Class A elevated aggravated assault, Class B aggravated assault and Class E violating conditions of release in relation to what police described as a brutal beating of then-25-year-old Sherri York in the early morning hours of Aug. 30, 2012.

Police have said they responded to reports of the altercation to discover York lying unconscious on Montgomery Street, and that witnesses pointed out Gwaro, an on-call firefighter, as the assailant. Police then arrested him after allegedly finding him hiding in nearby hedges and chasing him briefly to Peppermint Park on Cumberland Avenue. Gwaro had told police that he was actually chasing the real assailant when he was detained.

Lilley has said Gwaro admits assaulting York, but Lilley argues that Class A charges of elevated aggravated assault and attempted murder — which each carry a maximum sentence of 30 years in prison and $30,000 in fines — should be thrown out.

Lilley acknowledged Tuesday morning that his client “struck this woman hard, several times,” and said Gwaro would agree to charges of Class B aggravated assault and Class E violation of conditions of release for staying out past a 7 p.m. curfew mandated in his bail conditions after his initial arrest in the case.

But he said York, whose record includes a 2011 arrest on charges of engaging in prostitution, first propositioned Gwaro and then stole his money when he turned her down.

On Thursday, Lilley called Thornton out of order amid witnesses for the prosecution.

Thornton told jurors that he visited the homes of then-Montgomery Street resident Megan Lichterman and her then-fiance, Ryan Townsend, in December to take photographs out the windows from which the witnesses reported viewing the crime.

On Wednesday, Megan Lichterman — now going under the married name Townsend — was the first to testify that she saw the brutal assault take place.

Townsend offered jurors a chilling description of the attack and her neighborhood near the base of Munjoy Hill, where she said people who cooperate with police can face violent repercussions. Townsend said she, her then-fiance, brother and his girlfriend all initially refused to give sworn statements to police after the crime because of concerns they’d be labeled “rats.”

On Thursday, Thornton said that when he attempted to interview the Townsends, “both refused to talk with me, saying they didn’t want to ‘try to help the guy’ … on whose behalf I was working … they told me they wanted to see him go away for a long time.”