The Palestinian man who fatally stabbed one person and wounded six others at a Hamburg supermarket appears to have radicalised himself and says he decided to commit an attack in the hopes of dying a "martyr", German prosecutors said.
Federal prosecutors, who handle terrorism cases in Germany, said they were taking over the investigation of the suspect, identified only as Ahmad A in line with German privacy rules.
They said there is no evidence that he carried out Friday's attack as a member of Islamic State or any other terror organisation, or that he was in contact with or under the influence of a member of any terror group at the time.
There is also no evidence that other people were involved.
Prosecutors said that the investigation has pointed to a likely Islamic radical motive, and indicates that Ahmad A radicalised himself.
He has told investigators that he had been considering Islamic radical issues for some time and decided two days before the attack to live "a corresponding way of life", they added.
They said "on the day of the act itself, he consequently decided to commit an attack, linked with the hope of dying as a martyr".
The suspect carried out the attack with a kitchen knife he grabbed from a supermarket shelf.
He was then overwhelmed by passers-by and arrested, and is in custody on suspicion of murder and five counts of attempted murder.
Ahmad A, a 26-year-old who was born in the United Arab Emirates, had had his asylum application rejected and was co-operating with authorities in efforts to secure new identity papers so that he could be deported.
Officials have said that he was known to authorities as a suspected Islamic radical but not as a "jihadist".
They also considered him psychologically unstable but did not conclude that he posed any immediate danger.