The 25-year-old Libyan man accused of killing three people in a Reading park shouted “Allahu Akbar” moments before the attack, a court has heard.
Khairi Saadallah, who was living in the Berkshire town, is charged with three counts of murder and three counts of attempted murder.
He appeared at Westminster Magistrates’ Court via video link from Coventry Magistrates Court. Dressed in a grey, prison-issue tracksuit and wearing a surgical face mask, he spoke only to confirm his name and address and did not enter a plea.
Saadallah, who moved to the UK as a refugee in 2012, is alleged to have attacked his victims in Forbury Gardens on June 20 "without warning or provocation".
Jan Newbold, prosecuting, said: "At the time of the incident, the defendant was heard to shout words to the effect of "Allahu Akbar" (God is great)."
The court heard that just before 7pm, Saadallah is alleged to have targeted a group of seven sitting on the grass, stabbing four of them before turning to a group of five nearby, stabbing one in the back and one in the face.
An off duty police officer who witnessed the attack, called 999.
The three friends who were killed were James Furlong, 36, David Wails, 49, and Joe Ritchie-Bennett, 39.
Mr Furlong, a history teacher, and Mr Ritchie-Bennett, a US citizen, were each stabbed once in the neck while scientist Mr Wails was stabbed once in his back. They were all declared dead at the scene.
Saadallah is also charged with attempting to murder their friend Stephen Young as well as Patrick Edwards and Nishit Nisudan, who were sat in the the nearby group.
Mr Young needed 28 stitches for a “serious and deep” cut to his forehead while Mr Edwards was stabbed in the back and Mr Nisudan suffered wounds to his cheek and hand. They have all since been released from hospital.
Saadallah was questioned under Section 41 of the Terrorism Act 2000, before being charged on Saturday.
Chief Magistrate Emma Arbuthnot told him that the case was being referred to the crown court and that he would appear at the Old Bailey on Wednesday, likely via video link.