Dozens of commuters were forced to smashed windows to flee a smoke-filled subway train during the evening rush hour in Boston Wednesday.

According to the Massachusetts Bay Transportation Authority, the Orange Line train was about to depart Back Bay station shortly before 5 p.m. when smoke from an overheated motor became visible to the riders onboard.

Officials say the doors of the train remained closed because the train was moving away from the platform.

Videos posted on social media showed riders climbing out of a window to get off the train and on to the platform.

"Everyone was calm and there was a ton of smoke outside the train, and then a police officer starts hammering the window without warning," witness Claudia Frye told the Boston Herald. "And another police officer (was) screaming for everyone to calm down and ... everyone then started panicking."

"I noticed a haze coming from the platform and got to the top of the stairs and people were running up," witness Chris Herring told the Boston Globe

Service on the Orange Line and Commuter Rail trains was suspended after the incident.

Officials say five passengers were treated at the scene for smoke inhalation and three were taken to a hospital. None of the injuries are believed to be life-threatening. 

The MBTA said the affected train was taken out of service.