A man born in the United Arab Emirates has killed one person with a knife and wounded six others in a supermarket in the German city of Hamburg.
Police said the man shouted "God is greatest" before he was overpowered by passers-by and arrested on Friday.
They said they were unable to immediately determine the motive behind the attack and were "continuing to investigate every possibility".
Citing security sources, Berlin newspaper Der Tagesspiegel reported that the 26-year-old perpetrator was known to police as an "Islamist" and was born in the UAE, but they had not yet identified his nationality.
"It was definitely a lone attacker," Hamburg police said on Twitter.
Police said initial reports about a possible robbery had not been substantiated.
At about 13:10 GMT, the attacker stabbed to death a 50-year-old man believed to be a German citizen.
Police said the suspect "struck out wildly" at others, wounding five more in the supermarket, a 50-year-old woman and four men aged 19, 56, 57 and 64.
Another 35-year-old man was hurt while overpowering the attacker in the street alongside other passers-by shortly after the killing.
All of the wounded were being treated or operated on in hospital, some of them for serious injuries, police said.
A police murder unit and a specialist politically motivated crime squad are investigating the attack and were able to secure the suspected murder weapon.
A witness told DPA news agency that the attacker repeatedly shouted "Allahu akbar" (Arabic for "God is greatest") as he held up the knife.
|Germany has been on high alert, especially since last December's truck attack [Morris Mac Matzen/Reuters]|
"I thought I was in a horror movie, I thought he would kill me," an unnamed woman who had been in the supermarket told rolling news channel NTV.
She said she feared she would die, as she was "queueing for the till and couldn't get away".
The suspect fled the supermarket after the attack.
But "people were running after him with improvised weapons, chairs and sticks ... they ran after him into a side street," a witness Ralf W told Bild newspaper.
"People chased after the killer with chairs, they were throwing them at him," Shaylin Roettmer, bakery worker, told DPA.
The witnesses slightly injured the attacker while they were overpowering him, before handing him over to police.
Police blocked off the lively and diverse high street dotted with cafes and shops in the northeast of the port city, Germany's second-largest and host of the G20 summit of world leaders in early July.
While the attacker's motives remain unknown, Germany has been on high alert about the threat of attacks, especially since last December's truck rampage through a Berlin Christmas market that killed 12 people.
The Islamic State of Iraq and the Levant (ISIL, known as ISIS) group claimed responsibility for the carnage in which Anis Amri, 24, drove the stolen truck through a crowd.
In 2016, ISIL also claimed a suicide bomb attack in the southern city of Ansbach which wounded 15 victims, and a man's axe rampage on a train in Bavaria that hurt five, before the perpetrator was shot dead by police.
In one case of a homegrown attacker, a German teenager identified as 16-year-old Safia S was in January sentenced to six years of juvenile detention for stabbing a police officer in 2016 to support ISIL.
Authorities were also investigating an ISIL claim of the stabbing death of a teenage boy in Hamburg last October.
The 16-year-old boy was fatally wounded in the knife assault on the banks of the Alster river but a 15-year-old girl who was with him escaped unharmed after the attacker shoved her into the water.
Germany is a target, particularly because of its reconnaissance and refuelling missions to support the coalition fighting ISIL in Iraq and Syria, and because it has deployed troops in Afghanistan since 2001.