Tedi Fanta, 27, was on bail for brandishing a saw days before he armed himself with a blade and travelled to London from his home in Swansea, South Wales.
Shortly before 8pm on July 1 2021, he produced the weapon and jumped on retired civil servant Stephen Dempsey from behind, outside a Microsoft shop.
Two passing skateboarders feared they had been caught up in a terror attack but leapt into action and hit Fanta with their boards in a bid to disarm him.
They then helped to restrain the attacker until armed police arrived, while other members of the public tended to the 60-year-old victim, who was visiting the capital from Essex.
Mr Dempsey, who was born in Belfast, suffered four stab wounds and died in hospital later that night from a chest wound.
Prosecutor Caroline Carberry KC told the Old Bailey Fanta was “seen carrying out a ferocious, random and unprovoked attack on a helpless and unsuspecting member of the public”.
She said: “His victim could have been anyone who was in close proximity to him during the course of that day in central London. Sadly for Stephen Dempsey and his family, it was him.”
Because Fanta, who was suffering from paranoid schizophrenia, was deemed unfit to stand trial, jurors did not have to determine his guilt – only if they were sure he committed the acts he was accused of, Ms Carberry said.
They deliberated for less than an hour on Wednesday to find he had had a knife and carried out the murder.
The court was told Eritrean-born Fanta, who arrived in Britain in 2014, had convictions for criminal damage and assaulting a police officer and emergency worker and was on bail at the time of the killing.
He had been arrested on June 18 2021 for “brandishing a saw” in Swansea and then bailed to appear at Swansea Magistrates’ Court, the trial of facts heard.
Mr Dempsey’s sister Kathleen Dempsey has expressed concerns about how and why her brother was killed, the court was also told.
In a victim impact statement, Ms Dempsey said her brother was an “unassuming” man who had lived in Leigh-on-Sea in Essex since he was a child.
She said the retired civil servant had a “brilliant mind” and a “dry sense of humour” and loved live music and languages, particularly French.
Mitigating, Patrick Upward KC said Fanta was conscripted into the Eritrean army aged 12 or 13.
In the years of conflict that followed, the defendant was shot and tortured, Mr Upward said.
He eventually sought sanctuary in the UK and was granted refugee status but “by then the damage had been done”.
Mr Upward said Fanta was a “very, very ill young man”.
Judge Michael Topolski KC handed Fanta a hospital order without limit of time.
He said Fanta launched a “random and wholly unprovoked attack” and praised passers-by who went to Mr Dempsey’s aid.
He said Fanta had made seven court appearances in the past and been sectioned in 2020, adding: “This defendant slipped through the system unnoticed, uncared for, untreated and very dangerous.”