A man brandishing a knife in the German city of Würzburg killed three people and left several others injured, according to authorities.
Videos on social media showed the man armed with a large knife being confronted and subdued by passers-by.
The suspect, a Somali man aged 24, was shot in the thigh before being arrested.
Police said he had been violent and mentally unstable and had recently received psychiatric treatment.
The suspect is being questioned at a local hospital.
Officers are also searching his home and investigating his contacts for further evidence.
The attack took place at 5:00pm in the city centre’s Barbarossa Square.
Bavarian Interior Minister Joachim Herrmann told reporters that, of those who were injured, five were in serious condition and it was “not certain” if they would survive.