LONDON — A 26-year-old Libyan man pleaded guilty to murder Wednesday for stabbing three friends to death as they sat in an English city park.

Khairi Saadallah admitted to three counts of murder and three of attempted murder for the June 20 attack in Reading, 40 miles (64 kilometers) west of London.

James Furlong, 36, David Wails, 49, and Joseph Ritchie-Bennett, 39, were enjoying a warm Saturday evening in the city's Forbury Gardens park when they were stabbed. Each died from a single stab wound. Three other men were injured.

Police declared the stabbings a terrorist attack. Prosecutors said Saadallah, an asylum-seeker who was living in Reading, stabbed all six victims within two minutes while shouting "Allahu akbar" — the Arabic phrase for "God is great."

Judge Nigel Sweeney said during a hearing at London's Central Criminal Court that Saadallah maintained he was not motivated by an ideological cause and had not done substantial planning for the attack.

The judge set a sentencing hearing for the week of Dec. 7.