A man who tried to hijack a car with an automatic transmission, but fled when he realised he couldn’t drive it, has today been sentenced to three years in prison.

Gavin O’Leary (20) of Downpatrick Road, Crumlin, and another man dragged Hugh O’Neill from his black BMW just after he had parked on Dublin’s Fitzwilliam Square.

The men got into the car and were trying to drive away but were having difficulty moving it because it had an automatic transmission.

Mr O’Neill got help from a passer-by and alerted the gardaí but by the time they arrived, O’Leary and his accomplice had fled the scene, leaving the BMW behind.

O’Leary pleaded guilty at Dublin Circuit Criminal Court to unlawfully seizing a vehicle on December 28, 2010. He has nine previous convictions.

Judge Martin Nolan said the men had not “been competent enough” to drive the vehicle and accepted that O’Leary was under the influence of alcohol.

He said the crime was “too violent not to impose a custodial sentence” before he sentenced O’Leary to three years in prison with the final 20 months suspended.

Garda Isobel Hannon told Paul Carroll BL, prosecuting, that Mr O’Neill had just parked his car at 7.30am that morning, when he was thumped on the back of the head and shoulders and dragged from the car by his jacket.

He started shouting for help but when he noticed the two men were not able to drive his car he went back to try and stop them. He changed his mind and sought assistance from a person who had pulled up in his car to help.

Gda Hannon said O’Leary was arrested in February the following year after his fingerprints were found in the car. He made full admissions in a Garda interview.

A victim impact report stated that while Mr O’Neill did not bear O’Leary any “ill-will” he has been quite nervous since the attack and has lost confidence. He also felt he had to change his usual routine.

Padraig Dwyer SC, said his client’s behaviour was “unacceptable” but submitted that he was intoxicated on the night.

He said O’Leary is remorseful for his actions and described the crime as “quite amateurish”.

Counsel said his client worked with his father setting up stages in the theatre and has never served a prison term despite his previous convictions.