A young drink-driver kicked a female garda during a traffic check outside a shopping centre.
Lee Jay Miller assaulted the officer twice when he was stopped in west Dublin, Blanchardstown District Court was told.
Judge Gerard Jones gave Miller a three-month suspended prison sentence and referred the matter to the probation service.
He warned Miller he would lock him up if there was any repeat of the behaviour.
Miller (21), of Easton Mews, Leixlip, Co Kildare, pleaded guilty to drink-driving and having no insurance at Finns- town Shopping Centre, Newcastle Road, Lucan, on March 15, 2017. He also admitted assaulting garda Noelle Dunning in the incident.
Gda Thomas Pierce told the court that as Miller got out of his car, he shoved the door against the garda, knocking her back.
He later kicked her as he was arrested and placed in the back of the patrol car.
The court heard Miller was taken to a garda station where a blood sample tested positive. He had no previous drink-driving convictions.
A probation report was submitted to the court in relation to the assault.
The accused was an apprentice carpenter and was paid only a small amount, his lawyer told the court.
Judge Jones said he was "disappointed" with himself that he had referred the matter to the probation service.
He said that ordinarily, anybody who assaulted a member of the gardai would go "straight to jail".
However, he noted the probation report was favourable and suspended Miller's sentence for a year.
"If he comes before me again for this carry on, I'll lock him up as soon as I can," said the judge.
Miller was banned from driving for three years and fined €300 for drink-driving.
He was given a concurrent two-year ban and fined €400 for having no insurance.
Judge Jones said he would allow Miller six months to pay the fines.