A teenager swung at gardai and said "f**k off you p***ks" after he took issue with being stopped.
Sean Grehan (19) called gardai "c**ts" and told them they "couldn't stop him".
Judge Anne Watkin fined him €400.
Grehan, of Stradbrook Park, Blackrock, admitted before Dun Laoghaire District Court to threatening and abusive behaviour at Oliver Plunkett Road, Monkstown, last Aug-ust 2.
Gda Neil Doyle said he was on patrol at around 3pm when he stopped to speak to the defendant.
The officer said it was a warm day and he noticed Grehan because he was wearing a jacket and it was zipped up.
Gda Doyle said Grehan was aggressive and clenched his teeth. He called them "c**ts", said "f**k off you p***ks" and swung out at them.
Gda Doyle said Grehan was restrained and arrested.
The court heard he had never been in trouble before.
Grehan's solicitor said his client works in a supermarket and earns €200 a week.
He lives at home with his parents and is not paying rent.
The solicitor said Grehan took issue with gardai stopping him, and that was why he behaved in such a way.
Judge Watkin said she would leave Grehan without a conviction if made an €800 charity donation.
Grehan asked for a year to make the payment.
The judge asked for the reason for the length of time and Grehan said he had expenses for "socialising and transport".
When Judge Watkin refused to give Grehan a year to donate the money, he said he would accept a €400 fine.