BERLIN (AP) — A man armed with a kitchen knife fatally stabbed one person at a supermarket Friday in the northern German city of Hamburg and six others were injured as he fled, police said. He was overpowered and arrested.

The suspect is a 26-year-old who was born in the United Arab Emirates, police said, though they were still working to establish his nationality. Hamburg’s mayor said that the man had apparently sought shelter in Germany and that authorities had been unable to deport him because he had no papers.

The assailant entered the supermarket in Hamburg’s Barmbek district Friday afternoon and stabbed one man, who died at the scene. Police said the victim is believed to be a 50-year-old German.

After the assailant fled, he wounded a woman and four men with his knife before being overwhelmed by passers-by, police said. A fifth man was hurt while helping overpower the attacker, who was slightly injured, police said. Officers then arrested the assailant.

The wounded people, some of whom were seriously hurt, were taken to hospitals, authorities said.

Barmbek is in northeastern Hamburg, away from the downtown district.

Police said that they were “investigating in every direction.” The news agency dpa quoted two witnesses at a nearby bakery as saying they heard the assailant shout “Allahu akbar!” as he held up the knife, but police did not confirm the report.

“Allahu akbar” means “God is great” in Arabic and has been used by Islamic extremists when carrying out violent acts.

Mayor Olaf Scholz said the assailant was a foreigner who was supposed to leave Germany but couldn’t be deported because he had no papers, dpa reported.

“It makes me all the more angry that the perpetrator is apparently someone who sought protection here in Germany and then turned his hatred against us,” Scholz said.

In December, a Tunisian whose asylum application had been rejected drove a truck into a Christmas market in Berlin, killing 12 people.