He then walked inside and unwrapped a brand new kitchen knife with an 8-inch blade and began "brutally" attacking a pair of men, including the 50-year-old who died at the scene.
Police said the man was 26 years old but did not confirm his name or his nationality.
- Who was the attacker?
Before the attack, the man had entered and then left the store, Ms. Hennings said.
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.
A friend had tipped off authorities about changes in the man's behaviour, telling them he had stopped drinking alcohol and started talking about the Koran, said Torsten Voss, head of the Hamburg branch of the domestic intelligence agency. The Berlin incident was the last - and most deadly - in a series of assaults involving refugees that shook Germany past year in the wake of an influx of 1 million asylum seekers into the country in 2015.
The motive for the attack was not immediately known, but German media said it could be terrorism-related.
Kathrin Hennings, from the state police office, said the perpetrator bought bread from the supermarket before leaving and boarding a bus, but quickly returned, took a knife from a shelf, unwrapped it and launched the attack without warning.
A 35-year-old Turkish man finally managed to overpower him using a pole, Spiegel Online reported, suffering injuries himself in the process. "First reports about a possible robbery can not be confirmed so far", he said.
"He was always helping other asylum seekers with their paperwork", his neighbour, who gave his name only as Mohamed, told AFP.
Chancellor Angela Merkel opened Germany's borders in 2015, bringing more than one million asylum seekers to Germany since.
Mayor Olaf Scholz said it was a "malicious attack", adding that the alleged attacker was a foreigner whom authorities had tried to deport but couldn't because he didn't have the required documents.
According to the Bild newspaper citing witnesses, the attacker shouted "Allahu Akbar".
- Chicharito Return to Man United Wasn't Needed Says Jose Mourinho
- 'Atomic Blonde' Spoilers: Is There an End Credits Scene?
- Liverpool Reportedly Set Philippe Coutinho Fee at €150M to Scare off Barcelona
- Protesters gather against Trump ban on transgender troops
- Cook stands firm, England 149-4 in 3rd test vs South Africa
- Twitter Tumbles in Second Quarter with Stalled User Base
- PUBG To Offer Vanity Items Inspired by Battle Royale Movie
- Terminally ill baby Charlie Gard dies in hospice
- Branson Sells Stake in Virgin Atlantic in Broader Tie-Up
- Amit Shah Going to Be the Heir of Modi?