One man was killed and six people were injured in a stabbing attack in a supermarket in Hamburg on Friday, police said.

A 52-year-old German man was stabbed to death in an Edeka Supermarket. A 50-year-old woman and four men aged 64, 57, 56 and 19 suffered stabbing injuries. A 35-year-old man was injured while tackling the attacker, police said.

Police spokesperson Timo Zill said a kitchen knife was used in the stabbing, which he described as "indiscriminate" and "totally unexpected."

Police identified the attacker as a 26-year-old man born in the United Arab Emirates, but his citizenship was unclear.

An unconfirmed video widely shared on social media showed a group of people wielding chairs trying to subdue a man armed with a large kitchen knife.

The police said they did not yet know the reason behind the attack, but they announced that the homicide squad had taken over the investigation and would be looking into all possible motives.

Shortly after the attack, they also tweeted that streets would be closed off and asked people to steer clear of the area.

The supermarket where the attack took place was located at the intersection of Fuhlsbüttler street and Hermann-Kauffmann street in Barmbek, a northeast neighborhood in the northern port city of Hamburg.

Heavily armed police arrived at the scene of the attack to secure the area.

German police closed off the streets in the Hamburg neighborhood where a supermarket knife attack took place

Bystanders give chase

In a press statement, a police spokesperson said that the suspect had entered the supermarket and suddenly began stabbing customers before fleeing the building. Bystanders followed the suspect and overpowered the man in a nearby street. Plainclothes officers arrived shortly after and arrested the man.

After initial reports of the suspect being a robber, police later said that a possible robbery motive had not yet been confirmed. However, they tweeted that the attack "definitely" was undertaken by a single perpetrator.

Police could not confirm witness reports that the suspect had shouted "Allahu Akbar" in the supermarket.

"I do not have any detailed findings on the crime's sequence of events at this time," spokesman Zill told reporters. "The homicide squad will look meticulously into the crime and then will have to analyze what motivation, what reason, the perpetrator had for his action."

The suspect was slightly injured when taken down by bystanders. The website of the German daily Bild showed photos of the man in the back of a police car with a bloodied bag over his head.

A commission will be investigating the assault, the police reported.

In early July, other areas of Hamburg had been the sight of violent protests during the G20 summit of world political leaders.

Read more: Two German tourists killed in knife attack at Egyptian resort of Hurghada

German police assist an elderly woman after a knife attack in a nearby Hamburg supermarket

aw, cmb/msh (dpa, AFP, AP)