A plumber who was thrown out of a bar after a funeral drunkenly told gardaí they had no right to tell him to go home, a court heard.
Aidan Whelan (25) thought he was "sticking up for himself" when he told officers he would be returning to the pub.
Judge Dermot Dempsey ordered Whelan to donate €300 to charity and pay €150 compensation to gardaí and struck out the charges, leaving him without a conviction.
The defendant, of Castlegrange Avenue, Swords, admitted public drunkenness, threatening and abusive behaviour and failing to follow garda directions last January 31.
Garda Philip Walsh told Swords District Court that officers went to the scene following reports that a man had been thrown out of a pub on Brackenstown Road, Swords.
Gda Walsh said Whelan was intoxicated and was given a direction to go home, but he told gardaí they had "no right to tell him to leave".
The officer said Whelan was put in a cell in Swords garda station.
He banged on the door and threatened to urinate in the cell, which had to be deep-cleaned.
There was no evidence he had carried out the threat, his defence said, adding that he had since apologised for his behaviour.
Judge Dempsey noted that gardaí still had to pay for a deep-clean of the cell.
Defence said Whelan had had far too much to drink.
He thought he was "sticking up for himself", but instead he was committing an offence.