A schoolboy who triggered a murderous attack on a gay man in a Perth park joined the killers in bragging about the assault later, a court has heard.
Mr Kerr died later on the day of the attack
They left James Kerr, 51, dying and went to join friends at a party.
David Meehan, 19, admitted murder, while 21-year-old Martin Soutar admitted culpable homicide. The 15-year-old boy pled guilty to assault.
Meehan, Soutar and the schoolboy, who can not be named for legal reasons, will be sentenced on 9 November.
Mr Kerr, a Perth and Kinross Council worker of George Street, Perth, was attacked in the South Inch public park on 22 April.
Advocate depute Vinit Khurana said: "This case relates to an assault by the accused on the deceased. There appears to have been a homophobic element to the assault."
Mr Khurana said the schoolboy, from Perth, had been taking a shortcut home in the early hours of the morning across the South Inch public park.
He said the teenager was involved in a confrontation with Mr Kerr and another man and was heard to say: "If I ever see you again I am going to kick your head in."
Mr Kerr then briefly left the park, but returned and was spotted by the schoolboy, who used his mobile phone to call Soutar.
Soutar and Meehan were then dropped off at the park and the trio went to the boating pond in search of Mr Kerr.
Mr Khurana said the schoolboy hit him, then tripped him up and while Mr Kerr was on the ground Meehan and Soutar began kicking his head and upper body.
"The three of them then walked away leaving him lying on the ground bleeding heavily," Mr Khurana told the High Court in Perth.
He said the gang left a trail of bloody footprints and made no attempt to help Mr Kerr, who was struggling to breathe.
Mr Khurana said: "All three then made their way to a house party. At that party all the accused were heard to be talking about having just assaulted someone on the Inch."
Later, they walked past where the victim was lying as they went to visit friends. A woman walking her dog discovered Mr Kerr, who died later.
The trio were quickly traced by police and all eventually made confessions about the role they had played in the attack.
Meehan, 19, Glengarry Road, admitted murder and Soutar, 21, Darnhall Drive, both Perth, admitted culpable homicide midway through a trial.
In the wake of his death, the council's chief executive Bernadette Malone paid tribute to Mr Kerr, who was often present at major civic functions.
Sentence on all three was deferred to the High Court in Edinburgh on 9 November. The 15-year-old had bail continued while the older two were remanded in custody.