A young man caught trespassing in an office block in Dublin's International Financial Services Centre (IFSC) had got in to smoke cannabis, a court heard.
Jamie Chamberlain (22) and another man were arrested after gardai found them in the building following a call from security.
Judge Kathryn Hutton adjourned the case against the defendant for three weeks to see if he was suitable to complete a period of community service.
Chamberlain, of Kildare Park in Crumlin, pleaded guilty to trespassing at Exchange Place in the IFSC.
Garda Adrian Cahill told Dublin District Court that the incident happened on March 30.
Gda Cahill said he responded to an intruder call and, when he arrived, he was told by security staff that two men had entered the premises as trespassers.
When they were stopped, the pair told gardai they went into the office block to smoke drugs. They were arrested.
Questioned by defence barrister Emmet Nolan, Gda Cahill agreed that the accused was co-operative and gave "no trouble at all".
The court heard that Chamberlain had 19 previous convictions for public order, drugs, control of dogs and other offences.
"Mr Chamberlain and his accomplice were entering the building in order to consume cannabis and in the process committed the offence of trespassing," said Mr Nolan.
The court heard Chamberlain "did not put up any resistance" to the gardai.
The defendant was single and was living at home with his parents.
Chamberlain had suffered from a drugs addiction, which was evident from his previous convictions, said Mr Nolan.
He added that Chamberlain had struggled with both cannabis and cocaine in the past but had been clean for the past four months.
Chamberlain was on job seekers' allowance, the court was told.
Mr Nolan asked Judge Hutton to give the defendant credit for his guilty plea and to be as lenient as she could.
The judge adjourned the case to July 24 and said she would impose a 100-hour community service order instead of a one-month prison sentence if the defendant was found to be suitable.
He was not charged with any drugs offence.