An event management student caught with more than €900 worth of ecstasy in his bedroom had come under pressure to clear a debt and intended selling the tablets at a festival.
Alex Sako (21) was in a "desperate situation", a court heard.
Judge Bryan Smyth adjourned the case for the production of a probation report.
Sako pleaded guilty to poss- ession of ecstasy for sale or supply at his home at Sutton Park, Sutton, on May 30 last year.
Dublin District Court heard gardai searched the accused's address and found 91 blue tablets in his bedroom, worth €910.
Sako made full admissions when questioned and had no previous convictions of any kind.
The accused was a full-time student of event management and was working in an Italian restaurant, his solicitor Andrew Broderick said.
He was going to sell the drugs on a once-off basis at a festival to make good on a debt and had made a "poor decision", Mr Broderick said.
The accused had been in a desperate situation and was under pressure to pay his debt, the court heard.
"Lots of people are under pressure to pay debts and they don't turn to selling drugs," Judge Smyth said.
Sako was very remorseful for what had happened and cooperated with gardai. He understood it was a significant quantity of drugs but was anxious to avoid a conviction.
Adjourning the case to next month, the judge said he was not yet indicating a penalty.