Two teenage thugs barged into a house in Troon and attacked a boy after a disturbance outside a shopping centre.
George Prill, 19, and a 17-year-old co-accused, who cannot be named for legal reasons, appeared for sentencing at Ayr Sheriff Court last week following the incident in Welbeck Crescent in Troon on November 12.
The court was told that Prill and his co-accused had reacted after the victim of the attack posted on social media appearing to threaten the duo while brandishing a baseball bat.
The pair had previously pleaded guilty to charges of threatening or abusive behaviour, assault, and attempting to defeat the ends of justice.
The court was told that Prill and his co-accused had forced entry to the common close where their victim lived and went on to assault him by repeatedly punching him to the head and body following an incident near the Asda supermarket at the Rivergate Centre in Irvine.
The pair then threatened the victim with violence if he went to the police in an attempt to conceal their behaviour.
John Gallagher, defending, said there had been a disagreement over a broken mobile phone.
Mr Gallagher told Sheriff Desmond Leslie: “Both fully accept the seriousness of the matter.
“Both individuals were subject to a number of social media posts making threats while [the complainer] was brandishing a baseball bat.
“Friends [of the victim] had set upon Prill outside the Asda in Irvine. There was an agreement of reimbursement [for the broken phone], then this occurred, with social media posts taunting both accused.
“Neither has any previous convictions and there is nothing else outstanding.”
Sheriff Leslie told the pair: "You will both be subject to what's known as structured deferred sentences.
"In three months there will be a progress report. I will consider sentence at the end of six months."
Prill, of West Crescent, Troon, and the 17-year-old co accused will return to court at a later date to find out their fate.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules here