Murderer Kieran Davies was ordered to serve at least 19 years in prison before he becomes eligible to seek release on parole following the relentless fatal attack on Ashley Hawkins.
A judge told Davies at the High Court in Edinburgh: “You have been convicted on the clearest evidence of a particularly brutal murder.”
Lord Boyd of Duncansby said: “You continue to deny your guilt and you have shown little remorse.”
The judge acknowledged that Davies, 28, had had a difficult upbringing and told him: “You have not had the chances in life that may have set you a different path.”
Davies viciously assaulted his victim with a hammer and a metal bar during the murder at a flat in Scotland Street on December 2 last year.
The court heard that he and Mr Hawkins had arrived in the city from Wales as friends but before the fatal attack the victim had revealed that Davies had put a knife to his throat.
Davies had earlier denied murdering Mr Hawkins but after he was found guilty of the crime told security staff to take him downstairs to the cells as the judge addressed him and accused the prosecutor of framing him.
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 and forced entry found Mr Hawkins, 32, of Barry, in Wales, dead with catastrophic head injuries.
Unemployed Davies was the only other occupant of the locked property and was found topless, 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 court heard that drug user Mr Hawkins had suffered at least 24 blows to the head and a heavy metal pole and broken hammer recovered from the flat could have been used as weapons in the fatal attack.
Davies, a prisoner in Edinburgh, also repeatedly stamped and kicked 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 was locked and entry was forced and 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 along with other uniformed officers and attempts were made to help the victim.
Pc Ryan Murphy, 34, told the trial: “We could see the injuries were catastrophic. The firearms officers told us to stop.”
Prosecutor David Taylor told jurors: “When police came into that locked flat there were two people there _ one alive, covered in blood and one dead, violently murdered. There is no mystery in this case.”
Mr Taylor said that blood staining in the flat fitted in with the victim being pursued from the living room into the hall of the flat.
He said Davies and Mr Hawkins had come to Edinburgh from Wales “as best of friends” but added there was evidence that changed and there friction between them. He said that appeared to have reached a climax in the earlier incident when Davies menaced his victim with a knife.
Davies told police that he had taken Valium and claimed that he also had a needle of heroin and ecstasy. A blood test later proved negative for ecstasy and opiate drugs but gave an indication that he had taken diazepam and cannabis.
Defence counsel Keith Stewart QC, for Davies, said: “He maintains his position that he does not remember anything that happened in the flat.”
He asked the judge to deal with Davies on the basis that the murder was not a premeditated crime.
He earlier told the court that previously consideration had been given to Davies’ fitness to stand trial and a psychiatrist who had seen him reported that he suffered from a delusional disorder.