image copyrightReutersimage captionFive women and a child were also injured in the attack

The three people killed in a knife attack in the German city of Würzburg on Friday were all women, police say.

The 24-year-old suspect, a Somali immigrant, grabbed a knife from the kitchen section of a department store, attacking several inside. He then lashed out at people outside.

Five women and a child were also injured in the attack.

Police say the suspect was possibly psychologically unstable and may have held extremist Islamist beliefs.

On Saturday, he appeared in court, charged with three murders and six counts of attempted murder and causing grievous bodily harm.

The man allegedly seized a knife and stabbed and killed a saleswoman and two more women in the store.

He then injured five other women and a child on the street and in a bank.

  • Germany knife attacker kills three

Police were alerted to the attack at around 17:00 local time (15:00 GMT), in the city centre's Barbarossa Square.

Videos on social media of the incident, showed a man armed with a large knife being confronted and subdued by passers-by.

The suspect was shot in the thigh before being arrested.

Bavarian Interior Minister Joachim Herrmann told reporters that, "it is not certain if the most seriously injured will survive".

Officers have searched the suspect's home and are investigating his contacts for further evidence.

Police searched a homeless shelter, where he was registered to be living, and found his phone and leaflets with hateful messaging, police said.

A witness reported that the suspect shouted "Allah Akbar" during the attack, said Mr Herrmann.

But a police spokesman said that, while the attacker had a criminal record, none of his previous offences were related to terrorism.