West Yorkshire Police officers made the discovery at the properties on Autumn Avenue, Burnley when they were sent to investigate reports of a burglary.
Leeds Crown Court heard police received a report that a house on the street had been broken into on December 28 last year after three men were seen climbing through a window to get into one of the properties.
Erin Kitson-Parker, prosecuting, said the officers went into the cellar of a house and found that the walls had been knocked through so they could enter the cellars of both neighbouring properties.
A total of 215 mature cannabis plants were found along with 371 saplings.
The officers found 25-year-old Sabri Canaku asleep upstairs in one of the houses.
Canaku, an Albanian national, was arrested and questioned.
He told officers he had been living at the address for around a month.
Canaku accepted responsibility for the plants and said he had agreed to look after them to repay a debt to others who had arranged his illegal entry into the UK.
Canauku, of no fixed address, pleaded guilty to producing cannabis.
He has no previous convictions.
Christopher Dunn, mitigating, said Canauku pleaded guilty to the offence at an early stage and accepted he would be facing a prison sentence.
Mr Dunn said: "He expected to come here to work in the construction industry and ended up paying off a debt by producing cannabis.
"It was not the dream that he expected.
"He was living in terrible conditions.
"He was sleeping, eating and living in one room."
Recorder Gavin Doig jailed Canaku for 15 months.