Ghodratollah Barani, 26, throttled Mark Morrison, 46, from Stirling, with a piece of tent fabric in June 2012, Westminster Coroner’s Court heard.
He had previously claimed he was the king of Afghanistan and demanded to be let into Buckingham Palace but was thought to be faking symptoms to stay in the country.
Barani had recently had his application for asylum rejected, and was in the process of appealing at the time of the killing.
A court earlier heard Mr Morrison, who was born in the Dunblane area and also lived in Glasgow, had once had a successful career as a chef but was at that time sleeping rough in London. His favourite spot was on a bench at Marble Arch.
At an inquest into his death yesterday, two psychiatrists said they thought Barani’s claims that voices in his head were telling him to kill someone might have been a ruse to get asylum.
Barani was referred to Guy’s and St Thomas’s Hospital in London on 18 June, 2012, after he was found at the gates of Buckingham Palace, saying he was the king.
Dr Nancy Butler, a junior psychiatrist, assessed him with the help of a Farsi translator, and he told her he had tried to commit suicide on three occasions.
She said: “He said he tried to stab himself, tried to set fire to himself, and tried to suffocate himself with gas, but he had never needed medical attention afterwards. Although these sound like quite violent means to kill yourself, I was not convinced he had ever tried to harm himself.”
Barani was examined again at Guy’s and St Thomas’s when he referred himself, saying that voices were telling him to kill someone to become king.
Dr Neeraj Kabra, a senior psychiatrist at the hospital, said: “The voices told him if he killed someone he could become king and he needed to become king within three days.
“He said he had come to hospital to get help with the killing; I asked him what sort of help.”
Dr Kabra said Barani replied: “It’s the voices in my head telling me to kill someone and if I go to the hospital I can get help – help with the killing.”
He said Barani was very agitated because he had a meeting with the UK Border Agency at 11am and was very anxious he was going to miss his last chance of asylum.
He added Barani had also asked him to write a letter to support his application.
“I was not convinced he was having psychotic episodes,” he said.
The following day, Barani killed Mr Morrison.
Dr Cameron Ryan, a psychiatrist at London’s Gordon Hospital, assessed Barani the next day, when he had yet to be identified by police.
Barani had been referred to him by a social worker, and he also thought his actions might have been his way of furthering his asylum application.
Barani was eventually identified as the killer on 29 June after the attack was seen on CCTV footage.
He was held in the hospital wing of Belmarsh Prison for five months before he was diagnosed as having schizophrenia.
Coroner Dr Shirley Radcliffe said there was nothing to suggest Barani should have been held before the killing.
She said: “There was nothing to suggest he was detainable under the Mental Health Act.
“I conclude Morrison was unlawfully killed.”
Barani admitted the killing last year and was detained indefinitely.