A youth suffered head wounds in a bottle attack after rival groups clashed on a Motherwell street.
Police raced to the area after being alerted by CCTV operators, Hamilton Sheriff Court was told.
Casey Hamilton, 18, admitted that he and unknown accomplices assaulted Gavin McGuire to his severe injury and permanent disfigurement in Magna Street on September 14.
Hamilton, who was on bail at the time for carrying a hammer, also admitted using a bottle as an offensive weapon.
Jennifer McLaren, prosecuting, said the victim was with friends around 5.25pm when a group of around 15 males, including bare-chested Hamilton, walked towards them from a park.
She told the court: “Several were carrying bottles of alcohol and appeared aggressive.
“The accused and two others ran towards Mr McGuire and the accused struck him on the head with a Buckfast bottle.
“All three then punched and kicked him to the face, head and body, and one of the two youths with Hamilton struck Mr McGuire on the head with a second bottle.
“He was bleeding heavily from two wounds which required stitches.
“Police attended after being alerted by the CCTV operators and Hamilton was detained nearby.
“He told officers that Mr McGuire had pulled out a knife.”
Defence agent Diarmid Bruce said Hamilton’s grandfather had been assaulted by a group of youths the night before.
What followed was “a chance meeting” with those he believed to be responsible and “words were exchanged”.
Mr Bruce said: “He insists that a knife was brandished, though accepts that does not excuse what he did.
“He was under the influence and had a bottle of alcohol with him.”
The court heard that Hamilton who lives in Hamilton had been held in custody since September 16.
Mr Bruce said it was a new experience for him.
Sheriff Douglas Brown ordered Hamilton to carry out 225 hours of unpaid community work.
He told the teenager: “I won’t send you back to custody as you have spent a considerable period on remand, you are young and do not have much of a record.
“Hopefully, we won’t see you back in court.”