The migrant who killed one person and injured six others in a knife attack in a Hamburg supermarket on Friday was an Islamist known to German security forces, who say they believed he posed no immediate threat, the city-state's interior minister said on Saturday.
A possible security lapse in a second deadly militant attack in less than a year, and two months before the general election, would be highly embarrassing for German intelligence, especially since security is a main theme in the Sept. 24 vote.
A Tunisian failed asylum seeker killed 12 people by driving a truck into a Christmas market in Berlin in December, slipping through the net after intelligence officers who had monitored him reached the conclusion he was no threat.
Hamburg Interior Minister Andy Grote told a news conference on Saturday that Friday's 26-year-old attacker was registered in intelligence systems as an Islamist but not as a jihadist, as there was no evidence to link him to an imminent attack.
He also said the attacker, a Palestinian asylum seeker who could not be deported as he lacked identification documents, was psychologically unstable.
The Palestinian mission in Berlin had agreed to issue him with documents and he had agreed to leave Germany once these were ready, a process that takes a few months.
"What we can say of the motive of the attacker at the moment is that on the one side there are indications that he acted based on religious Islamist motives, and on the other hand there are indications of psychological instability," Grote said.
"The attacker was known to security forces. There was information that he had been radicalised," he said.
"As far as we know ... there were no grounds to assess him as an immediate danger. He was a suspected Islamist and was recorded as such in the appropriate systems, not as a jihadist but as an Islamist."
Prosecutors said the attacker pulled a 20-centimetre knife from a shelf at the supermarket and stabbed three people inside and four outside before passers-by threw chairs and other objects at him, allowing police to arrest him.
A 50-year-old man died of his injuries. None of the other six people injured in the attack is in a life-threatening condition.
Chancellor Angela Merkel is seeking a fourth term in office in September. Her decision in 2015 to open Germany's doors to more than one million migrants has sparked a debate about the need to spend more on policing and security.
Tunisian asylum seeker Anis Amri, who could not be deported because he lacked identification documents, carried out his attack at a Christmas market in Berlin in December after security agencies stopped monitoring him because they could not prove suspicions that he was planning to purchase weapons.