He was a “three strikes” burglar, which put him in line for a minimum custodial sentence of three years.

He committed his previous home burglaries in 2009, when he was 14, and 2010, when he was given a referral order and a youth rehabilitation order.

Duncan McReddie, defending, said it was an exceptional case and it was not in the interests of justice to put the teenager behind bars.

He said Bainbridge had been a regular visitor to the Brotton house. “That right was taken away from him by the property owner. He continued to visit the daughter of the household with whom he was in a relationship,” added Mr McReddie.

“She was a minor. They carried on that relationship, effectively behind her parents’ back.

“He was tempted by the Xbox and he stole it. He’s always been candid about his activities. He made full and frank admissions to police.”

Bainbridge accepted he had a problem with cannabis and owed “significant sums of money” to dealers.

He made “significant and very useful progress” under an order.

There had been a “marked change” in his behaviour. He was trying to re-establish a relationship with his family and steer clear of trouble, added Mr McReddie.

Bainbridge wrote to a letter to Judge Simon Bourne-Arton QC, the Recorder of Middlesbrough.

The judge told the defendant: “This was a mean and nasty offence. It resulted in no great loss but you took advantage of a friendship with this girl and you went and stole her parents’ property.”

Giving him credit for his guilty plea and time spent on a curfew, the judge locked him up for 834 days.

As he left, Bainbridge said “I love you” to a young woman who was crying in the public gallery.