A burglar was still standing in the kitchen of a house he had broken into when gardai arrived.
Martin Daly (26) and an accomplice had kicked in the front door and stole a number of items, a court heard.
Judge John Cheatle imposed a four-month sentence which he suspended for a period of 12 months.
The defendant, of Curran Park, Balbriggan, admitted before Swords District Court to burglary at Bath Road, Balbriggan, shortly after 5pm on October 22 last year.
Gda Joey Carolan said Daly and an accomplice kicked in the front door of the house and were still standing in the kitchen when gardai arrived on the scene.
Daly was then arrested and placed in the back of a patrol car where he tried to conceal a number of items that he had stolen.
Defence solicitor Fiona D'Arcy told the court that Daly had battled a heroin addiction for a number of years, but was now stabilised on 80mls of methadone and had been doing well in recent months.
However, his uncle had died recently and this had had a bad effect on him.
In relation to this incident, Ms D'Arcy said the defendant was holding his hands up to his part in it.
She added that Daly, who was unemployed and on social welfare, was living with his grandmother in Balbriggan.
Ms D'Arcy said the defendant was focused on reducing his methadone intake and staying away from drugs.
The court was also informed that Daly had very poor literacy skills, little formal training and also had difficulties concentrating.