German police say three people have been killed and others injured in a knife attack in the southern city of Würzburg.
Police spokeswoman Kerstin Kunick said officers were alerted at around 17:00 CEST on Friday to a knife attack on Barbarossa Square in the city centre.
Police said the attacker was arrested after officers used firearms.
They've identified the suspect as a 24-year-old Somali, who lives in Würzburg. He was wounded by a police bullet but his injuries are not life-threatening.
The man was in psychiatric treatment before the attack and had been known to police, Bavaria's Interior Minister Joachim Herrmann said.
Five people were injured, some seriously, according to Germany's DPA agency.
Police said on Twitter that there is no danger to the population and they not seeking anyone else in connection with the incident.
Videos on social media show an armed man walking barefoot through the centre of Würzburg, carrying a long weapon.
Images show the attacker being surrounded and chased by numerous pedestrians, who could be seen throwing chairs and other projectiles.
Police declined to immediately provide further information and urged social media users to refrain from speculation.
The region's prime minister Markus Söder described the news as "horrific and shocking" on Twitter.
"We mourn with the victims and their families. We fear and hope with the injured," Söder said.
"A big thank you and respect for the courageous intervention of many citizens who resolutely confronted the alleged attacker. And to all the rescue workers for their efforts at the scene."
Würzburg is a city of about 130,000 people in Bavaria, located between Munich and Frankfurt.