A teenager told a garda he was an "ugly c**t" and threatened to "slit his face", a court heard.
Darren O'Brien (19) was drunk at the time and doesn't remember much about his behaviour.
Judge Hugh O'Donnell fined O'Brien €500 and imposed a three month sentence, suspended for 12 months.
The defendant, of The Cottages, The Grange, Edenderry, Co Offaly, admitted before Dun Laoghaire District Court to public drunkenness and threatening and abusive behaviour.
The court heard Garda James Nolan was on mobile patrol in Cabinteely village on July 26, 2013 when he came across the defendant.
He was very drunk and when Garda Nolan went to arrest him, O'Brien called him "an ugly c**t" and threatened he would "f**king kill him".
O'Brien also attempted to swing a few punches in the direction of Garda Nolan.
He further threatened to "slit his face".
The court heard O'Brien was also arrested for a breach of the peace at Corrig Avenue in Dun Laoghaire on November 13 last.
In that incident, Garda Paul Maher told the court that O'Brien had come into the garda station asking about a friend.
He was very drunk and abusive and did not listen to gardai when he was told to desist in his behaviour.
The court heard O'Brien has 14 previous convictions, including six for public order matters.
Defence lawyer Rory Staines said O'Brien was very sorry for his behaviour.
Mr Staines said there is a pattern behind his offending, and he gets into trouble when he drinks to excess.
Mr Staines said O'Brien, who is unemployed, is not drinking at all now.
He said the defendant is originally from Dundrum but moved to Edenderry to live with his brother when he started getting into trouble in Dublin.
Judge O'Donnell said O'Brien's behaviour was "not nice".