A teenager caught dealing cannabis on the street had built up a €2,000 debt and got involved with "unscrupulous people", a court heard.
Christopher McPhilips (19) was heavily under the influence of cannabis and had €600 worth of the drug down his trousers when gardaí stopped him.
Judge Gerard Jones adjourned the case for a probation report.
McPhilips, of The Croft, Castletown, Celbridge, Co Kildare, pleaded guilty to possession of cannabis with intent to sell or supply.
Blanchardstown District Court heard gardaí saw the accused acting in an "evasive manner" at Maynooth Road, Celbridge, at 10pm last Nov- ember 8.
He was searched and found to be in possession of €600 worth of cannabis deals.
McPhilips, who had no previous convictions, deeply regretted the shame he had brought on himself and his family, his solicitor told the court.
He was heavily under the influence of cannabis at the time of the incident, was examined by a doctor and deemed unfit for questioning for six hours.
McPhilips had voluntarily handed over the cannabis, his solicitor said.
The offence arose from him "getting involved with unscrupulous people".
He had been fearful of these individuals, but the debt had since been fully cleared by the accused's father, his lawyer added.
Judge Jones adjourned the case and said he wanted a "glowing report".
If this happened, he said, he would leave the accused without a conviction.
"However, if you are back with this carry on you will sit in Mountjoy for quite a while," he warned.