A teenager told a female garda she was a "fat pig" when she asked him to move on, a court heard.
David Botena (19) was "just being stupid" when he made the comments to Gda Nicola McMorrow, Swords District Court was told.
He was ashamed and embarrassed at his behaviour, said Annette Kealy, defending.
Judge Miriam Walsh ordered Botena to donate €300 to charity.
In return, she left him without a conviction.
Botena, of Orylnn Park, Lusk, admitted threatening and abusive behaviour in Station Road, Lusk, shortly before 11pm last July 22.
The court was told Gda McMorrow was dealing with another matter when Botena approached her.
When she asked him to move on, he became abusive and said: "Look at her, fat pig."
Gda McMorrow said Botena had apologised later that evening for his remarks.
Ms Kealy said her client, who had never been in trouble before, was studying hospitality at college.
She said he regretted his behaviour, which was out of character.