A Libyan man on Wednesday pleaded guilty to three murders and three attempted murders after stabbing six people in an English park earlier this year.
Khairi Saadallah, 26, had been due to stand trial over the attack in Forbury Gardens in Reading, west of London, on the evening of Saturday June 20.
But at a pre-trial hearing at the Old Bailey court in central London, he pleaded guilty to the charges.
Saadallah was initially arrested by police on suspicion of murder but then re-arrested under counter-terrorism legislation.
The prosecution's case is the stabbings were a terror attack -- but judge Nigel Sweeney told the court Saadallah had denied being motivated by an ideological cause.
Prosecutor Alison Morgan said the case merited a "whole life" term in prison. Sentencing was adjourned until the week of December 7.
The court will examine whether Saadallah was motivated by religion, politics or ideology, any pre-meditation and planning and the influence of his mental state at the time.
Three friends -- history teacher James Furlong, 36, US expat Joe Ritchie-Bennett, 39, and David Wails, a 39-year-old scientist -- each died from a single stab wound in the attack.
Three other people were taken to hospital for their stab injuries to be treated and later released.
The stabbings followed two high-profile knife attacks near London Bridge, central London, in November last year, and another in Streatham, in the south of the capital, in February.
Two people were killed in the first and three people injured in the second.
The perpetrators, who were both shot dead by armed police, were both convicted terrorists released early from prison.
Saadallah was known to Britain's security services after intelligence that he planned to travel abroad, possibly for terrorism purposes.
But the threat was deemed to be "insubstantial".
Britain's domestic Press Association news agency quoted court documents as saying Saadallah arrived in the country as a refugee, after fleeing conflict in his native Libya.
He had six previous convictions for 11 crimes between June 2015 and January last year, including racially aggravated assault, knife offences and criminal damage.
In November 2018, he was detained under the Mental Health Act, and was said to have a history of debt, homelessness, alcohol and substance misuse.
He had suffered from post-traumatic stress disorder, depression and a personality disorder, which made him "aggressive and unpredictable", the documents showed.
He had been released early from prison in June after a previous sentence had been reduced on appeal.