Murderer Kieran Davies and Ashley Hawkins had arrived in the city from Wales as best of friends but, before the fatal attack, the victim revealed that Davies had put a knife to his throat.
Davies had denied murdering Mr Hawkins but, after he was found guilty of the crime, told security staff to take him downstairs to the cells as a judge addressed him and accused the prosecutor of framing him.
Defence counsel Keith Stewart QC told Lord Boyd that Davies’ conduct appeared to be contemptuous of the court and the judge’s authority.
The final stage of the trial took place in the murderer’s absence as Lord Boyd told jurors: “Murder cases are always difficult. They are emotionally draining for everybody involved in it.”
Police who were called to the second floor flat at 7 Scotland Street in December last year found Mr Hawkins, 32, of Barry, in Wales, dead with catastrophic head injuries.
Unemployed Davies, 28, was the only other occupant of the locked property. He was found topless and wearing jogging bottoms and trainers extensively stained with the dead man’s blood.
A Reebok top, which Davies had earlier been seen wearing, was found in a washing machine, saturated with the victim’s blood.
The High Court in Edinburgh heard that drug user Mr Hawkins had suffered at least 24 blows to the head. A metal pole and broken hammer recovered from the flat could have been used as weapons in the fatal attack.
Davies, a prisoner in Edinburgh, was found guilty of murdering Mr Hawkins on December 2 by repeatedly striking him on the head with weapons and stamping and kicking him on the head and body.
Police were alerted to the incident in the early hours of the morning after neighbours heard banging and shouting coming from the flat. One teenager was aware of 15 to 20 bangs and screaming which had stopped by the end of the disturbance.
The witness was confident that no one left the premises from the end of the banging until the arrival of officers. Police found the front door of the flat locked and entry was forced. An attempt was made to resuscitate the victim who was lying face down covered with a blanket and surrounded by a pool of blood. An armed response unit and a dog handler had been dispatched to the flat.
Lord Boyd said there was only sentence he could impose for a murder conviction, adding that he would have to fix a minimum period that Davies must serve in prison before he can be considered for parole.
The judge deferred sentence on Davies until next month for a background report. Mr Stewart told the court that consideration had been given to Davies’ fitness to stand trial and a psychiatrist reported that he suffered from a delusional disorder.