A man who stashed about £20,000 of drugs in a railway station locker was caught when staff noticed the smell.
A member of staff at Aviemore railway station noticed the strong smell of cannabis when he walked past, and called the police on October 2 last year.
A search warrant was obtained and 1.2 kilos of herbal cannabis with a street value of between £12,860 and £17,290 was recovered.
It was contained in 50 packages in a backpack placed there by James Logan, now of Melbourne Street, North Berwick, but who formerly lived in Aviemore.
Officers also found seven blocks of cannabis resin weighing 66grams and with a street value of 3,320 pounds.
When 44-year-old Logan returned to collect the backpack two days later, police moved in and arrested him.
Sentence was deferred by Sheriff Sara Matheson until January 14 for a background report.
Defence solicitor Natalie Paterson reserved her comments until then.