Three teenagers have been charged with a hate crime after they allegedly harrassed and assaulted a woman who they believed was an immigrant on an MBTA train last week.

Prosecutors said the teens, two 15-year-old girls from Dorchester and another 15-year-old girl from Mattapan, began verbally assaulting a 49-year-old woman who boarded a Red Line train at Savin Hill station around 7:30 a.m. Nov. 7.

"Go back to your own country,” the girls allegedly said, mocking the woman’s accent and English proficiency.

When the woman attempted to leave her seat, the group allegedly blocked her to prevent her from moving. One of them, prosecutors said, repeatedly punched and struck her in the face with a cellphone.

A witness pressed the train’s emergency call button to report the incident at Andrew Station. MBTA Transit Police responded to the scene and spoke to witnesses who corroborated the distraught victim’s account. One witness described the group as “celebrating” once they left the train.

Police were able to identify the teen girls with help from Boston Public Schools based on a photo taken by one of the witness on board the train.

All three girls have been arraigned on hate crime charges and were charged with assault and battery with a dangerous weapon and civil rights violation causing injury.  All three juveniles were released to their parents’ custody with orders to stay away from one another, the victim, and witnesses in the case.

Prosecutors also obtained orders protecting the victim’s name and personal information from the juveniles.

“The immigrant experience is encoded in our nation’s DNA,” Suffolk County District Attorney Daniel F. Conley said, commending witnesses who notified police. “We want to make sure that everyone feels safe and secure, no matter who they are, where they’re from, how they speak, or how they define their families. There’s no room for behavior like this – period.”

All three defendants are due back in court Nov. 30.