A man’s body lay in his Fife flat for more than a fortnight after he was killed by his friend, a court heard.
Aleksandrs Sokolovs, 29, died after he was attacked by Sergejs Samarins at the flat they shared in Glenrothes in March last year.
Samarins, also 29, flew into a rage after the victim taunted him about a previous spell in prison.
A judge heard how the killer later returned to the flat in the days after the attack.
Police at one stage turned up, but left after a man – believed to Samarins – told them everything was “fine”.
Mr Sokolovs mother in Latvia became increasingly concerned as she had not heard from her son.
On April 13, more than two weeks after the attack, officers returned and forced entry and discovered Mr Sokolovs’ body.
Samarins – who had faced a murder allegation – pleaded guilty to a culpable homicide charge at the High Court in Glasgow.
Lord Burns imposed an interim compulsion order on Samarins, who is currently in the State Hospital at Carstairs.
The Latvian will return to the dock in November.
The court was told Mr Sokolovs was repeatedly punched during the fatal assault and also hit with a chair.
He died due to a brain injury as a result of the attack.
Frances McMenamin QC , defending, said Samarins had “no idea what to do” when he returned to the flat and found his friend still lying on the floor.