A motorist caught driving on the wrong side of the road raced away at speed when he saw gardai.
Neil Guerrine (31) then abandoned the vehicle at the end of the road near his home.
He accepted that his behaviour was "very stupid".
Judge Patricia McNamara imposed a five-month sentence, suspended for one year, and banned Guerrine from driving for three years.
The defendant, of Cloonmore Road, Tallaght, admitted before Tallaght District Court to careless driving as well as driving without insurance or an NCT certificate.
Guerrine was originally charged with dangerous driving but a plea was accepted to the lesser charge of careless driving.
The incident happened at Fortunestown Road, Tallaght, shortly before 5pm on April 10 last year.
Sgt Michael Ahern said gardai were on vehicle patrol when they came across Guerrine, who was driving a grey Nissan Almera on the wrong side of the road.
Sgt Ahern said that when Guerrine saw the officers he drove away at speed.
The sergeant said the car was found abandoned at the bottom of Cloonmore Road, not far from the defendant's home.
Sgt Ahern said gardai later made the demand for Guerrine to show his insurance and NCT certificate but he failed to produce them.
The court heard Guerrine has 61 previous convictions, including four for uninsured driving and three for dangerous driving.
Defence lawyer Stephen Montgomery said his client has a young child and his partner is pregnant.
He injured his wrist some time ago and is out of work and on sickness benefit.
Mr Montgomery said the defendant accepted his behaviour was "incredibly stupid" and wished to apologise for it.
The lawyer accepted that Guerrine has a bad record, but had not been in trouble for a while, and he asked the judge to give him "one final chance".
Guerrine also told the court he realised his driving could have been dangerous if there had been any oncoming traffic.