A man born in the United Arab Emirates killed one person with a knife and wounded six others in a supermarket in the German city of Hamburg on Saturday, shouting "Allahu Akbar" before being overpowered by passers-by and arrested, said police.
Police 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. News agency DPA reported that security authorities were investigating evidence the man had Salafist ties.
Around 1310 GMT, the attacker stabbed to death a 50- year-old man believed to be a German citizen.
Police said that he "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.
German daily Bild published a picture of the attacker in the back of a police car with a white, blood-soaked bag over his head, and reported that he cried "Allahu Akbar" (God is Greatest) during the attack.
"Suddenly I saw a man smeared with blood running along the other side of the road with a knife," an eyewitness identified as Ralf W. Told Bild. "He shouted out 'Allahu Akbar' as he was running."
A female witness standing in line at the supermarket till also told NTV rolling news channel that "as he was running out... He held up his arms and shouted 'Allahu Akbar'."
"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," Ralf W. Told Bild.
"People chased after the killer with chairs, they were throwing them at him," bakery worker Shaylin Roettmer 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.
Anti-terror officers armed with automatic weapons patrolled the scene and onlookers gathered behind strips of red-and-white police tape.
While the attacker's motives remain unknown, Germany has been on high alert about the threat of a jihadist attack, especially since last December's truck rampage through a Berlin Christmas market that killed 12 people.
The Islamic State group claimed responsibility for the carnage in which a Tunisian rejected asylum seeker and ex- convict, Anis Amri, 24, ploughed the stolen truck through a crowd.
It was Germany's deadliest attack by an Islamist militant, but not the first.
In 2016, the IS group also claimed a suicide bomb attack in the southern city of Ansbach which wounded 15 victims, and an Afghan man's axe rampage on a train in Bavaria that hurt five, before the perpetrator was shot dead by police.
Public fears about more extremist violence have grown amid Germany's mass influx of refugees and migrants, mostly from Syria, Iraq, Afghanistan as well as several African countries.
More than one million asylum seekers have arrived in Germany since Chancellor Angela Merkel opened the country's borders in 2015.
Germany's domestic intelligence service estimates there are about 10,000 radical Islamists in the country, including 1,600 who are considered potentially violent.
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 the Islamic State group".
Authorities were also investigating an IS 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 for jihadist groups, particularly because of its reconnaissance and refuelling missions to support the coalition fighting IS in Iraq and Syria, and because it has deployed troops in Afghanistan since 2001.