A Somali man went on trial in Germany on Friday accused of stabbing three people to death and injuring several others, with prosecutors seeking to have him placed in psychiatric care.
The suspect, an asylum seeker with a history of mental health problems, faces charges including murder and attempted murder before the Wuerzburg district court in Germany's southern Bavaria region.
The attack took place in the city centre of Wuerzburg last June.
The suspect stands accused of using a long kitchen knife in a random attack on people at a household goods store before running into the street. Three women were killed and nine people injured in the rampage.
Prosecutors initially considered an Islamist motive but this suspicion was not confirmed in the investigation that followed.
Two court-ordered experts have said the suspect suffers from paranoid schizophrenia.
The trial will seek to determine whether he can be held criminally responsible for his actions.
Munich prosecutors are not asking for a prison sentence, but want the man to be committed to a closed psychiatric facility.
According to the prosecutors, the suspect has said that voices in his head told him to carry out the attack because he felt unfairly treated in Germany.
The Somali arrived in Germany in 2015.
Berlin took in more than a million asylum seekers in 2015-2016 at the height of Europe's migrant crisis.
The influx was deeply divisive in Germany and fuelled the popularity of the far-right AfD party.