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

An Afghan teen attacked passengers on a train in Germany Monday using bladed weapons, severely injuring at least three people, and was later shot dead by a SWAT-style team, authorities said.

The incident happened on a train in Heidingsfeld, near Würzburg, police said. The weapons were described as an ax and a knife.

A firefighter stands at a road block in Wuerzburg, Germany, July 18. Reports state that a man allegedly wielding an ax injured multiple passengers on a regional train in Wurzburg. Karl-Josef Hildenbrand / EPA

Officers shot and killed the attacker, police said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The attacker was a 17-year-old Afghan man, Bavaria's interior minister, Joachim Herrmann, said in an interview on German public television ARD. Herrmann said the police team shot the attacker after he exited the train and charged them.

Police said at least three people suffered severe injuries and 10 to 20 people have what were described as light injuries, but the majority of those suffered from shock and not directly from the attacker.

Police said it is too early to determine a motive or whether the incident might be terrorism related.

Hermann was quoted by NBC's German partners ZDF as saying the 17-year-old was an unaccompanied refugee, and lived with a caretaker or foster family in Ochsenfurt, south of Würzburg. The train passed through the town, but it was unclear when he boarded.

The suspect lived "for some time" in in Ochsenfurt, Hermann said. The police team that killed the suspect was there by chance, and was nearby on an unrelated event, Herrmann said.

He said authorities were still investigating the motive of the attack and were looking into reports that the suspect had yelled out "an exclamation" during the rampage, The Associated Press reported. He was responding to reports that some witnesses had heard the suspect shout "Allahu Akbar" ("God Is Great") during the attack.

The attack on the train comes days after a driver rammed a truck into a crowd in Nice, France, at the end of a Bastille Day fireworks show, killing 84 people. Authorities in France have called that attack an act of terrorism.

In Germany in May, a man armed with a knife killed one person and injured three others in a dawn attack on a train station near Munich. The attacker in that case was arrested.

Würzburg is a city in northwest Bavaria, about 74 miles east of Frankfurt.