A teenager caught dealing heroin three times in Dublin city centre was easily led, had built up a drug debt and got in "way over his head", a court heard.
Eoghan Cassidy (18) was arrested for repeatedly selling heroin in broad daylight on the city's quays.
Judge John O'Leary referred his case to the drugs treatment court.
Cassidy, of Moorefield Avenue, Clondalkin, pleaded guilty to possession of drugs for sale or supply.
Dublin District Court heard the first incident happened at Wood Quay last February 1.
Cassidy was seen acting suspiciously with another person and, when approached by gardai, he put something into his mouth.
He was directed to spit it out and it was found to be four bags of heroin. He was searched at a garda station and the total value of drugs found was €560.
Cassidy was stopped on High Street, Dublin 8, at 3pm on March 29. He was acting in a suspicious manner and, when searched, had five deals of heroin worth €100 in his underwear.
Cassidy was seen acting in a suspicious manner again at Richmond Street South at 11.30am last May 7.
When gardai approached and spoke to him, Cassidy placed a package in his mouth. This was recovered and found to contain heroin worth €280.
Cassidy also admitted obstructing a drugs search in another incident, on February 2.
Gardai saw him in what was believed to be a drugs transaction with another person and, when approached, he ran and threw two trays of tablets to the ground.
The offences all happened in a four-month period when the accused had got in "well over his head" in servicing a drug debt, his solicitor Niall Walsh said.
The accused, who had ADHD, had been through a very difficult period after falling out with his family over his drug use.
He had worked in customer service but had not "found his niche" and seemed to have "lost his way" in his teenage years, Mr Walsh said.
He started dabbling in drugs and was "easily led and easily taken advantage of".
He found himself in dire straits, selling drugs "not once, not twice but three times" to feed his own habit and pay off his debts.