A young man with "a temper issue" got into a garda's face and threatened to break his jaw and rape his mother, a court has heard.
Joshua Byrne (20) had been stopped by the officer after he had "given the fingers" to a passing patrol car.
Judge Anne Watkin said the defendant's behaviour was "outrageous".
She ordered a probation report and adjourned sentencing to a date next month.
Byrne, of Kilcross Square, Sandyford, admitted public drunkenness and threatening and abusive behaviour.
Gda Brian Kirwan told Dun Laoghaire District Court that he was on patrol at Stillorgan Park Road, Stillorgan, last July 8, when he stopped to speak to the defendant.
Gda Kirwan said he had initially stopped because Byrne had given the patrol car the fingers as it went past.
The garda asked Byrne why he had behaved in such a manner and the defendant told him it was because he "wanted to".
Gda Kirwan said Byrne then squared up to him, putting his forehead to the garda's head.
He told the garda that he would "break my jaw" and "get me". Gda Kirwan said Byrne also threatened that he would "rape my mother".
The defendant was drunk at the time.
The court heard Byrne had four previous convictions, for robbery and assaults, and had received a lengthy sentence for those matters in 2016.
Defence solicitor Ronnie Lynam said this incident should not have happened and Byrne's behaviour was "completely unacceptable".
Mr Lynam said Byrne had a "temper issue", and without proper control it resulted in outbursts that were "very unsavoury".
The solicitor said Byrne was a "vulnerable" young man.
He was in court with his mother and was now working in a retail outlet.
Mr Lynam said the defendant was under post-release probation supervision.
A probation officer said alcohol was an issue, but he had failed to attend addiction counselling. Byrne told the court he's "off the drink".