A teenager lashed out at gardai after he had too much to drink while celebrating St Patrick's Day.
Jordan Joyce (19) was with a large group of youths drinking in a Swords park, but the others walked away when they saw gardai.
A court heard Joyce was so drunk that he collapsed on the ground and gardai had to help him to his feet.
Judge Dermot Dempsey ordered Joyce to complete 240 hours of community service in lieu of two months in prison.
The defendant, with addresses at Jugback Green and St Cronan's Close, Swords, admitted before Swords District Court to public drunkenness and threatening and abusive behaviour at River Valley Park, Swords, last, March 17.
Gda Thomas Murphy said he was on bicycle patrol at around 6.30pm when he came across a large group of youths who were carrying beer and Irish flags to celebrate St Patrick's Day.
Gda Murphy said the youths moved off when they saw gardai, apart from Joyce, who collapsed on the ground.
He said Joyce was highly intoxicated and became violent towards him and his colleague, aggressively striking out at them with his fists.
Gda Murphy said Joyce also pulled the epaulettes from his colleague's shirt.
The officer said Joyce was taken to Swords Garda Station where his violent behaviour continued.
He said Joyce, who has no previous convictions, later came into the garda station and apologised.
Defence solicitor Fiona D'Arcy said the defendant is a young man who suffers from anxiety and depression.
She said he was drinking heavily around the time of the incident.
Ms D'Arcy said he now realises he needs help and he is due to start counselling this week.
She said the teenager would also benefit from working with the probation services.
Judge Dempsey told Joyce he was "getting an opportunity" to complete community service and he should use it wisely.