A drug addict described by his own barrister as "a zombie" has been jailed.
Jamie McCarron's craving was so strong he dived at a tray of diazepam tablets in front of police officers in a bid to have a last snort during his arrest.
The 22-year-old, from Moyola Drive in the Shantallow area of Londonderry, consumed up to three boxes of diazepam a day, each containing 28 tablets.
Police arrived at McCarron's home on April 16 last year with a warrant to search the property.
McCarron brought them to his bedroom and revealed a stash of drugs including 40 morphine tablets, 12 oxycodone tablets, 1,092 diazepam tablets, just over two dozen alprazolam and zopiclone tablets and a some cannabis.
After examining the defendant's phone, officers found messages from 23 drug dealers and 38 messages sent by McCarron offering to supply drugs.
The defendant, who pleaded guilty to possessing the drugs and guilty to possessing several of them with intent to supply, was described by police as an addict who bought and sold drugs to feed his own habit.
Defence barrister Eoghan Devlin said his client became chronically addicted after the deaths of family members and friends.
"He was effectively living the life of a zombie," he added. "He was living in a stupor for most of the day, then he went out and collected drugs to sell to others.
"When the police arrived at his home he tried to consume lines of white powder. He realised he was going to jail and such was his craving for the drugs that he wanted one last fix."
Sentencing McCarron, Judge Babington noted he had three previous convictions for drug offences and that one of the messages found on his phone had referred to thousands of pounds.
"Possessing drugs with intent to supply, particularly Class A drugs, is a very serious offence," he added. "It is clear he is or was deeply involved in supplying drugs.
The judge ordered the destruction of the drugs and of McCarron's computer and mobile phone. He also told the defendant that he would spend 18 months in custody and a further 18 months on licence.