A man who killed his housemate on Christmas Eve had been arrested weeks earlier for attempting to scale the fence at Buckingham Palace, a court heard.
Dylan Thomas, 24, pleaded guilty to the manslaughter of William Bush, 23, in December 2023, but denies murder.
Cardiff Crown Court heard that the pair had met at school at Christ College in Brecon, Powys, and had been friends since.
Mr Bush was popular but “Dylan Thomas had few friends and was viewed as something of a loner,” said Gregory Bull KC, prosecuting, adding his “only real friend was the deceased”.
The jury was shown a police interview with Mr Bush’s brother, Alex, from the 12 January 2024.
In the interview, he told detectives he had spoken to his brother via Facetime who told him Mr Thomas had been arrested on 6 November for trying to climb over the palace’s fence.
Mr Bush said “Will laughed it off” and told him “it was Dylan’s nature”.
He said his brother was popular, always had lots of friends, adding that he was “too caring at times”.
The court heard that William Bush and Mr Thomas lived together on Chapel Street, Llandaff.
The “dynamics” of their close friendship began to change when Mr Bush got a girlfriend and was planning to move in with her, the court heard.
The jury was also shown a recorded police interview with William Bush’s girlfriend, Ella Jefferies.
She talks about Mr Thomas being on bail following his London arrest.
Ms Jefferies also describes her boyfriend barricading himself in his bedroom and feeling scared after a discussion with his housemate.
The court was told Mr Thomas said: “I thought and wondered about killing you. I just wanted to see what would happen if I do certain things.”
Ms Jefferies said there were a number of weapons at the house – a samurai sword bought by the defendant in Austria and a “couple of BB guns”.
On 23 December, Mr Thomas went to stay with his grandmother in Rhoose, Vale of Glamorgan.
Mr Bush had planned to spend that evening with Ms Jefferies and then Christmas with his family in Brecon.
At his grandmother’s house, Mr Thomas seemed unsettled, the court was told.
Mr Bull said at 00:36 on 24 December, he carried out a search on his computer for the “anatomy of the neck” and at 02:42 sent Mr Bush a text message saying he needed to see him before he went to Brecon for Christmas.
Mr Bull said that indicated that Mr Thomas was formulating an intention to kill his housemate.
At 03:31, Mr Thomas tried to book an Uber taxi to Chapel Street, but was unable to.
The following morning his grandmother, Sharon Burton, agreed to drive Mr Thomas to Llandaff, because he said he wanted to walk the dog.
On the journey, Mrs Burton described him becoming “more and more agitated” and sending several text messages.
She parked outside the property while Mr Thomas went in.
The prosecution say he then armed himself with two knives, one large kitchen knife, and another flick knife, and went up two flights of stairs to Mr Bush’s bedroom, where an attack began.
Mr Bush sustained a total of 37 stab wounds, which included 13 to the front and side of his neck, eight to the back of his neck, seven to the front of his trunk and eight to the back of his trunk.
He also suffered a slash to his face, a cut to his ear and 13 cuts to his left hand.
Mrs Burton, who has hearing loss, then saw Mr Thomas banging on her car window distressed.
“Passers-by heard screams of horror coming from the address,” said Mr Bull.
Mrs Burton then found a wounded Mr Bush on the patio outside the property and began to give him CPR.
The jury listened to a 999 call made by Mr Thomas in which he asked for an ambulance to come to the car park on Chapel Street.
He told the operator his friend had “gone mental” and stabbed him.
He was asked by the 999 operator to describe the injuries and where they were.
“Everywhere on him, I kept going and stabbed him. I didn’t stop,” he said, adding: “he stabbed me on my hands, my hands to get the knife.”
“This was a planned attack,” said Mr Bull, adding: “He deliberately armed himself with knives and attacked him from behind.”
Mr Bull told the jury that Mr Thomas is being treated for schizophrenia at Ashworth High Secure Hospital on Merseyside, from where he’s appearing via videolink.
Mr Thomas denies murder and the trial continues.