Hassan Mustafa decapitated Khalid Yousef with a knife before mutilating his face and one of his hands, Birmingham Crown Court heard.
Yousef, a former housemate of the accused, was attacked by Mustafa, 35 at the time of the killing, at a branch of Paddy Power in Handsworth in January.
Jurors were invited to return a “special verdict” of not guilty of murder by reason of insanity, if they believed Mustafa did not know that what he was doing was wrong.
The court heard Mustafa, who is suffering from paranoid schizophrenia, “believed he was killing a supernatural being rather than a human being” in a competition.
Prosecutor Jonathan Rees QC said the defendant and Mr Yousef were Sudanese nationals who sought asylum in the UK five years ago and had lived in Liverpool.
Mr Rees said 28-year-old Mr Yousef’s wounds suggested the mutilation had been “carried out with some skill” and could have reflected the training Mustafa received while studying medicine.
The prosecutor also reassured jurors that if they found the defendant not guilty of murder by reason of insanity, Mustafa would not be released until he was no longer considered a danger.
After the court case, Detective Inspector Jim Colclough, of West Midlands Police, said: “This was a horrific and unprovoked attack on a young man who had his whole life ahead of him.
“I would like to thank the staff at Paddy Power for their brave actions, I can’t imagine how terrified they were. Our thoughts also remain with Khalid’s family at this difficult time.”