Mohammedi Zhykar, who was being held on remand, broke down in tears and pleaded to be let out when told he would have to stay in jail until a trial date could be fixed.
Presiding over the case at Leeds Crown Court, Judge Christopher Batty then told him he if he changed his plea to guilty, he would be handed a suspended sentence and be released immediately, which he accepted after a brief discussion with his barrister, Benjamin Bell.
Prosecutor Jade Edwards told the court that police raided an address on Florence Grove in Harehills on the afternoon of December 1, 2018, and found a 17-year-old Zhykar crouching down near the kitchen sink.
Underneath the sink they found 122 small grip-seal bags full of cannabis, another two bags in the living room, along with £845 cash and three mobile phones.
The bags of drugs, worth a total of approximately £1,250, contained 11 fingerprints that matched Zhykar.
He gave no comment during interview and failed to answer to custody after being released pending inquiries. A co-accused also fled and has yet to be found.
Zhykar, whose last address was given as Stanifield Lane, of Leyland, Lancashire, was eventually re-arrested and placed on remand.
He continued to deny a charge of drug dealing, claiming he was only at the property to buy cannabis and had been leafing through the bags, explaining why his fingerprints were left on them.
Judge Batty then said it would need to go to trial and refused him bail because of his flight risk, which triggered his emotional outburst.
After a short break in the proceedings, the 21-year-old chose to switch his plea but no mitigation, other than his young age at the time of the offence, was offered by Mr Bell.
He was given six months’ jail, suspended for 12 months, and ordered to carry out 175 hours of unpaid work.