A man who broke into Windsor Castle armed with a loaded crossbow to kill the late Queen has apologised to the Royal Family for bringing "such horrific and worrying times to their front door".
Jaswant Singh Chail, now 21, was 18 when he was detained in the castle grounds having been found with the weapon on Christmas Day 2021.
He has admitted treason and since been detained in a psychiatric facility.
At a court hearing at the Old Bailey on Friday, his barrister Nadia Chbat said he has written to the King and his family to say sorry.
"He has expressed distress and sadness about the impact his actions had on the Royal Family, particularly while Her Majesty was in her latter years," she told the court, concluding seven days of evidence on his mental state.
Claiming he has written the King a letter, she added: "He has apologised to the Royal Family and His Majesty King Charles.
"He is embarrassed and ashamed he brought such horrific and worrying times to their front door. He has expressed relief no one was actually hurt. It is important to him there was a surrender."
'Kind and gentle' before mental health declined
In his defence, his family said he was a kind, gentle and often funny character, before his mental health declined.
But the imposition of COVID national lockdowns was the backdrop for his ill-health, his barrister added.
He and his father, a software consultant working in aerospace, his mother, a special needs teacher and his twin sister, a university student, were a "tight family unit", she told the hearing.
But that unit has been "utterly shocked and devastated" by his actions, she said.
"That deep regret will be with him for the rest of his life because of the severity of the offending that took place."
Read more from Sky News:
American XL bully dogs to be banned
Man posed as model scouts to get explicit pictures of girls
The Star Wars fanatic went to Windsor having adopted a persona from the film franchise, which he called "Darth Chailus", his lawyer said.
He was wearing dark clothes and a metal mask.
Seeking revenge for Sikh massacre
Chail, from Southampton, sent a WhatsApp video to family and friends apologising for what he was about to do.
He said he was seeking revenge for the victims of the Amritsar massacre of 1919, when British troops killed thousands of Indians, given his Indian Sikh heritage.
He had tried to get close to the royals through failed bids to join the armed forces, the court was told.
The fact his crossbow was loaded should mean his sentence is longer, Prosecutor Alison Morgan KC told the hearing.
"I can think of three offences carrying a sentence of life imprisonment which Mr Chail could have faced, particularly if he had lifted that crossbow up in the castle," she said.
Judge Mr Justice Hilliard will have to decide whether he should be jailed, detained under the Mental Health Act or face a "hybrid" order.
His treating psychiatrist Dr Christian Brown, who recommended a hospital order, suggested Chail will need around 18 months of one-to-one therapy.
But Professor Nigel Blackwood, for the prosecution, said the attack was carefully planned and Chail was well aware it was wrong.
Chail, who appeared via video link from the high-security psychiatric hospital Broadmoor, has also admitted making a threat to kill the Queen. He will be sentenced at the same court on 5 October.