A man accidentally set fire to his council house trying to grow more than £10,000 worth of cannabis in his bedroom, a court heard.
Police and firefighters discovered Sean Joyce's cannabis cultivation after it burned a hole through to the living room below at his Milnathort home.
Joyce, 47, now of Kinross, admitted producing the drug on 8 March this year.
He was ordered to carry out 200 hours of unpaid work at Perth Sheriff Court.
Depute fiscal Bill Kermode told the court: "Whilst the fire service were extinguishing the fire they discovered this cannabis cultivation in the rear bedroom.
"There was a ceiling fan, heat lamps and plants which were approximately two feet in height.
"There was a significant hole in the floor where the fire had burned through to the living room below."
Mr Kermode said an SSE engineer made the property safe and confirmed there was no sign of the electricity meter being bypassed.
The engineer said he believed the way the electrical supply had been set up in the bedroom for the cultivation was a fire hazard.
Solicitor Paul Ralph, defending, said: "At least it is refreshing to come across an operation of this kind where he was actually going to be paying for the electricity.
"If ever there was a lesson that tells you 'don't do it' then surely Mr Joyce has had that hammered home to him here."
Sheriff Gillian Wade told Joyce: "This is a serious offence, particularly because your cannabis cultivation resulted in a fire breaking out at the local authority house where you were residing.
"I appreciate it was not a supply operation, but was for your own use."