A teenage driver who drove dangerously through a housing estate narrowly missed a five-year-old child who was outside playing, a court has heard.
Wesley Maughan (18) had earlier driven at high speeds, running red traffic lights and forcing other motorists to take evasive action to avoid him.
Gardai had chased him after they spotted him fleeing the scene of a theft.
Judge David McHugh sentence Maughan to three months in jail and banned him from driving for two years.
The defendant, of The Villas, Granby Row, Carlow, admitted charges of theft and dangerous driving when he appeared before Blanchardstown District Court.
The dangerous driving took place at Lucan Road, Chapel Hill, Ballydowd Grove, Rose-lawn estate and Lower Lucan Road, all in Lucan, last May 5.
Maughan also admitted stealing €500 in cash at St Catherine's Park, Lucan, and possession of a screwdriver, gloves and an engineer's file.
Sgt Geraldine McManigan said gardai were alerted to a theft at St Catherine's Park. On their way to the scene they met a silver Ford Mondeo which was driving at great speed.
Sgt McManigan said Maugh- an drove at high speeds on Lower Lucan Road and at Chapel Hill, causing other motorists to take evasive action.
He also drove at speed through a red traffic light and through Ballydowd Grove, where he narrowly missed a five-year-old child.
Sgt McManigan said the car was abandoned at Ballydowd Grove. Two men jumped out - Maughan, who was the driver, and a passenger. Maughan was caught after a short chase.
Jennifer Jackson, defending, said Maughan, a married father-of-one, had a cocaine habit at the time of the incident.
She said he had begun dabb-ling in the drug and it quickly spiralled out of control.
Ms Jackson said Maughan wished to express his remorse, and he was thankful there were no casualties. He was very ashamed of his behaviour.
Judge McHugh said Maugh- an's driving was "appalling".
Maughan immediately app-ealed the sentence.