A reveller out celebrating his birthday was arrested after he began shouting obscenities at gardai outside a pub.
Mark Kirby (23) had been told to move on after he was found shouting threats at doormen, but he returned to verbally abuse the officers.
Judge Ann Ryan said he could avoid public order convictions if he takes part in a restorative justice programme.
Kirby, of Dunsink Drive, Finglas, pleaded guilty to public intoxication and threatening, abusive and insulting behaviour.
Blanchardstown District Court heard the incident happened at the car park of The Full Shilling pub on Main Street, Finglas, last August 6.
Gardai were called to a disturbance and found Kirby outside the pub shouting at security staff in a threatening and abusive manner.
He was highly intoxicated, Gda Sgt Maria Callaghan said.
When gardai asked him to move on he began to walk away from the scene.
He turned a corner, but returned a short time later and began shouting obscenities at the officers.
He failed to stop and was arrested and taken to Finglas Garda Station, where he became fully co-operative.
Kirby had no previous convictions. He was embarrassed and deeply apologetic for his behaviour, defence solicitor Geraldine Wycherley said.
He had been out all day celebrating his birthday and "clearly had too much to drink".
Kirby had worked in Dublin Port but lost his job in 2015. He previously had a drug addiction, which he was "candid about" and for which he had sought help.
He had since got back on the "right track" and was working full-time again with his previous employer.