Identified as a 26-year-old man of Palestinian origin, he had arrived in Germany in 2015, but was due to be deported as his application for asylum was rejected.
The assault risks reopening a bitter debate over refugees two months before general elections, putting pressure on Chancellor Angela Merkel over her decision to open Germany's borders in 2015, letting more than a million asylum seekers in.
“He was known as an Islamist but not a jihadist,” said the German port city's interior minister Andy Grote, noting “there are indications of radicalisation”.
But the minister stressed that while there could have been an Islamist motive for the attack, the suspect also suffered from “psychological instability”.
“It remains unclear which was the overriding element,” he said.
Police piecing together the assault on Friday said the man had entered the supermarket and took a kitchen knife measuring around 20 cm from the shelves.
“He ripped off the packaging and then suddenly brutally attacked the 50-year-old man who later died,” said deputy police chief Kathrin Hennings.
He later wounded two other men in the supermarket before fleeing, slashing others along the way, before he was overpowered by courageous passers-by.
Witnesses told AFP the man had brandished the bloodied knife, shouting “Allahu Akbar” (“God is Greatest”) as he fled the scene, but that bystanders gave chase and flung chairs to stop him.
If confirmed as an Islamist attack, it would be the first in Germany since Tunisian Anis Amri drove a truck into crowds at a Berlin Christmas market on December 19th, killing 12 and injuring 48.
Germany has been on high alert over the threat of a jihadist assault since Amri's rampage in Berlin, for which the Islamic State group claimed responsibility.
Like the Hamburg suspect, Amri was due to have been deported after his asylum request was turned down, but the process was held up by a lack of identity documents.
News website Spiegel Online named the supermarket attacker as Ahmad A., while officials said he had not filed an appeal against Germany's decision to reject his asylum application.
In fact, he had helped to obtain documents to facilitate his departure from Germany.
On the day of the attack, he had even gone to the authorities to ask if the identify papers had arrived. Police chief Ralf Meyer said the suspect was “almost exemplary” in this aspect.
Heavily armed police who searched a Hamburg asylum seekers' shelter where the man lived did not find any weapons.
'Intelligent but achieved nothing'
At the asylum shelter in a leafy suburb, the suspect's neighbour, who gave his name only as Mohamed, described him as “very intelligent”.
“He was always helping other asylum seekers with their paperwork,” the 31-year-old Syrian refugee told AFP.
But in recent weeks, he “had a crisis, he bought Islamist clothes and read the Koran very loudly in his room”.
“And three weeks after Ramadan, he had another crisis. He started to drink heavily and smoke joints… he was sad that his mother was ill and that his asylum request was rejected,” recounted Mohamed.
“I find this whole story very sad. He is 26 years old and… he has not achieved anything. And now we don't know what he did this,” he added.
On the high street in northeast Hamburg where the assault struck, residents laid flowers and candles outside the supermarket, which was closed.
Asylum debate reopens
Ahead of elections in September, the latest assault is expected to rekindle the debate over the record refugee influx.
“It makes me especially angry that the perpetrator appears to be a person who claimed protection in Germany and then turned his hate against us,” said mayor Olaf Scholz.
Beatrix von Storch of the Islamophobic populist party Alternative for Germany (AfD) had stronger words, writing on Twitter that “before Mrs Merkel tweets again that this is 'beyond comprehension': this has something to do with Islam. Comprehend that once and for all!”
AfD's support has fallen back in polling since the height of the migrant crisis, but the party remains on course to clear the threshold of five percent of the vote to enter parliament for the first time.