A man was jailed for six months at Elgin Sheriff Court after trying to raise a bus fare by selling heroin to a stranger.
The court heard that Duncan Stewart, 39, travelled from Peterhead to Elgin to buy drugs worth up to £1,630 on September 2 last year.
But defence advocate Bill Adam, said that in his “exuberance” at making the purchase, Stewart forgot to keep enough money to pay for a bus home.
When he approached a woman on Elgin’s Springfield Road and asked whether she was interested in buying some of the drugs, police were contacted.
Fiscal depute Kevin Corrins said: “The accused initially asked the lady if she knew anyone who wanted to buy heroin, and she indicated that she did not know any such person.
“The accused then asked her if she wanted any heroin and she declined the invitation.”
Police found Stewart with 7.83 grams of heroin in his possession, which if sold in £10 bags could fetch £1,630.
Stewart, of 4 Churchill Drive in Peterhead, admitted charges of supplying a class A drug.
Defence advocate Mr Adam said Stewart, who has several previous drugs convictions, had turned his life around since meeting his wife about ten years ago.
But said the accused turned to heroin for comfort when his spouse was recently diagnosed with cancer.
He explained: “The situation has been causing him some concern and led to him reverting to his previous habits.
“On that particular day he travelled to Elgin to purchase heroin but, in his exuberance at doing so, he failed to take into account he had to return to Peterhead and arrived at the bus station
with no money.
“What followed must have been an unpleasant experience for the young lady.”
Sheriff James Hendry said: “I accept that the accused was using heroin as a crutch and to that extent he has my sympathy, but a custodial sentence is merited in this matter.”