Counsel for McDonagh cited a probation report describing him as having a “disarming, self-deprecating sense of humour” and a “particular charisma”.

Garda David Corcoran told Noel Devitt BL, prosecuting, that neither victim had wished to make a victim impact statement.

The court heard that in the stolen car case, the victim had returned to his home on Camden Street on the night in question to discover an open door and some furniture items moved. He and other family members became suspicious that someone was in the house after they heard someone breathing and saw a silhouette.

They also discovered that three designer sunglasses and car keys were missing, and on investigation, the resident realised that his rental car which had been parked around the corner was also missing.

Gardaí were alerted and they intercepted McDonagh on the N7 near Naas a short time later. His DNA was also found on a tack remover found at the house.

McDonagh had been on bail at the time for other offences.

Some two months later, gardaí got a call one morning from a priest living in Dublin city centre who had spotted three men throwing a wallet and bank cards into his garden.

Gardaí rang the person who owned the cards and found her extremely upset, having just been robbed by three men in St Stephen's Green. The woman said she had noticed the three men on her way to work and heard them singing the children's nursery rhyme, “Heads, Shoulders, Knees and Toes”.

She became suspicious and quickened her step, but one of the men approached her and grabbed her bag, spilling the contents. She said she felt terrified and saw all three men picking up the contents of her bag and running out of the park.

The three men were all identified on CCTV footage; the two co-accuseds are also before the courts.

Keith Spencer BL, defending McDonagh, said his client had written letters of apology to both victims.

Mr Spencer said his client had had a very difficult childhood and was “the product of his environment” but had managed to stabilise on methadone and planned to wean off the drug completely within the next month.

The court heard that McDonagh requested to serve his sentence at the Midlands prison, in order to be near his family and to be away from certain influences in Mountjoy.