A man who faced drugs charges after a fire at his Blantyre home has narrowly avoided a prison sentence.
Firefighters called to the blaze found cannabis plants growing in a bedroom.
Police later seized cocaine and ecstasy from the property.
Mark Rouse, 26, appeared at Hamilton Sheriff Court this week.
He admitted producing cannabis at his then home in Camelon Crescent on October 6, 2019.
He also admitted being concerned in the supply of cocaine and ecstasy.
Aga Mathieson, prosecuting, said that when the alarm was raised firefighters had to force entry to the empty house.
She stated: "They found a tent containing cannabis plants, lamps and heaters in a bedroom.
"Thereafter police got a search warrant and 16 cannabis plants were recovered.
"Police officers also found cocaine worth £1400 and 844 ecstasy pills, worth between £250 and £500."
Ms Mathieson said the value of each cannabis plant ranged from £200 to £400, so the total worth of the cultivation was between £3200 and £6400.
No cause for the fire was given, but police have warned repeatedly about the fire risks posed by cannabis cultivations that require intensive heating and lighting.
Rouse has no previous convictions and has since moved to Bute.
Defence agent Andy Iles said he had "distanced himself" from negative influences.
The solicitor added: "The criminal justice social work report is very positive. He has mental health issues and is more than willing to undergo supervision in the community."
Sheriff Liam Murphy said he took into account the fact that Rouse was a first offender.
The sheriff told him: "I consider that, on a narrow margin, there is an alternative to custody available."
Rouse was put under supervision for 18 months and ordered to carry out 160 hours of unpaid community work.
* Don't miss the latest headlines from around Lanarkshire. Sign up to our newsletters here.
And did you know Lanarkshire Live is on Facebook? Head on over and give us a like and share!