Police discovered a cannabis farm capable of producing £72,000 worth of the drug when they searched a house in Leeds.
Officers found 167 plants growing on three floors of the property on Bellbrooke Avenue, Harehills.
A court heard the officers were called to the street on an "unrelated matter" at 4.30am on September 8 this year.
Phillip Adams, prosecuting, said the officers knocked on the back door of the house after noticing a strong smell of cannabis.
Banush Jolla answered the door and the officers found plants growing in five rooms of the property.
Fifty plants were in the cellar, 69 plants were in two bedrooms on the first floor and 48 plants were in two attic bedrooms.
Leeds Crown Court heard 137 plants were over four feet in height.
Read more: Teenage sex predator who stalked schoolgirls locked up for grabbing 12-year-old girl in Leeds street
Mr Adams said: "This was a sophisticated set up.
"The plants were growing under strong lights.
"The wall had reflective coverings, there was sheeting at the windows, a ventilation system, carbon filters and the electricity meter had been bypassed."
The prosecutor said the plants were capable of producing cannabis with a street value of £72,000.
Jolla, an Albanian national, was arrested and told police in interview that he had been living in the UK for two months.
He said he had come to West Yorkshire from London as he was struggling to find somewhere to live.
The 22-year-old said he had been told he could stay at the property on Bellbrooke Avenue rent-free as long as he helped to water and look after the plants.
Read more: Robber threatened to stab 15-year-old boys outside Leeds Corn Exchange
Jolla pleaded guilty to producing cannabis.
Rukhshanda Hussain, mitigating, said Jolla had been involved in looking after the plants for two weeks before he was arrested.
Miss Hussain said Jolla faced being deported when he is released from custody.
She added: "He was exploited because he was here illegally."
Jolla was jailed for 12 months.
Judge Robin Mairs told the defendant: "This was a professional and sophisticated set-up.
"You were also clearly motivated by financial advantage."