Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A knife-wielding man set fire to a train in Switzerland on Saturday before going on a stabbing rampage that left six people injured, including a 6-year-old, police said.

The 27-year-old suspect, a Swiss national, was also hurt during the attack, said police in St. Gallen, in northeastern Switzerland.

The unnamed suspect is accused of spilling a flammable liquid on the train when it was approaching the Salez station, and caused the liquid to catch fire. He was also carrying at least one knife, police said in a statement.

A display reads "Do not enter" on the train where a 27-year-old Swiss man attacked passengers on Aug. 13 at the station in Salez, Switzerland. ARND WIEGMANN / Reuters

Emergency responders, including police, firefighters, paramedics and emergency helicopter crews, arrived at the scene shortly after the 2:20 p.m. local time (8:20 a.m. ET) attack, police said.

The six victims — a 6-year-old, a 17-year-old girl, a 17-year-old boy, a 34-year-old woman, a 43-year-old woman and a 50-year-old man — were hospitalized with burn and stab wounds, as was the suspect, according to police. Some of those wounded were in critical condition.

Several dozen passengers were on the train at the time of the fire and stabbing spree, police said.

A police spokesperson told NBC News that it is unclear whether the attack was terror-related. The St. Gallen prosecutor is investigating.