A Vietnamese cannabis farmer fled from an upstairs window when police raided his illegal growing operation.
Thanmanh Nguyen jumped onto a low roof at the back of the house in St Paul's Road, Hartlepool.
Neighbours alerted police who found Nguyen hiding in a bush in the garden.
More than 260 plants were found growing in the house which could have yielded as much as £221,000 if sold on the street, Teesside Crown Court heard.
"The grow was a professional one," said Chris Wood, prosecuting.
"It was spread over two floors and four rooms.
"Also recovered from the property was an iPhone and £40 cash."
Nguyen initially claimed he had been trafficked to Hartlepool from his home in Vietnam.
"An examination was carried out of the iPhone," added Mr Wood.
"Nguyen claimed it was not his, but there was a series of selfies of him on it.
"It was also found he was communicating freely using the iPhone in the weeks leading up to his arrest.
"The Crown say a person being held captive would not be given free use of a phone."
Nguyen, 18, of no fixed abode, admitted producing a class B drug on July 26, last year.
Andrew Turton, defending, said in mitigation: "He maintains he was brought to this country from Vietnam two years ago at the approximate age of 16.
"He travelled via Russia under the supervision of others, arriving in Hartlepool about a month before his arrest.
"The cannabis farm was already in operation, he took over from somebody else.
"He watched as that person was beaten for apparently refusing to carry on looking after the plants.
"All Mr Nguyen did was water the plants as he was instructed to do.
"He never left the house because he was fearful of the consequences of doing so."
Judge Stephen Ashurst ordered Nguyen to serve two years in a young offenders' institution.
The judge told him: "This was a large and sophisticated cannabis grow, capable of yielding a significant amount of the drug.
"There is nothing to support your claim you were being coerced into looking after the plants.
"The selfies and text traffic on the iPhone show you in a relaxed mood."
Judge Ashurst ordered the confiscation and destruction of the cannabis plants and growing equipment.
Nguyen will be automatically deported at the end of his sentence.