“The defendant appeared to walk out of the way behind a wall. He took a woolly hat out of his back pack and put it on.

“He picked up one of three bikes from Saltview Terrace and rode off along Seaton Carew Road, where he was detained by officers.”

She added: “The defendant said he’d seen the bike lying in the middle of the road and he’d picked it up fearing a car may hit it. He said he needed to get back to Hartlepool so was going to ride the bike there and hand it in at Hartlepool police station.

“It was put to him, however, that he was seen taking the bike without the owner’s consent and it wasn’t lying in the middle of the road.”

Wells appeared before justices and pleaded guilty to taking the bike without the owner’s consent on September 18.

He also admitted stealing food, worth £9.23 from Sainsbury’s, in Murray Street, on September 30.

Mitigating, Barry Gray said his client – who was jailed for eight years for holding a replica gun to an 84-year-old woman’s head and threatening to “blow her brains out” in April 2004 – suffered a serious heart attack while serving his sentence for the horror attack in prison and had to have several operations.

He now takes a cocktail of 20 pills a day for severe angina, lung and back problems.

He said: “Rather than police transporting him back to Hartlepool, he was simply released from the police station without any money or transport, and in those circumstances he set off to walk and he came across this bike.

“Perhaps the owner would have been happy to lend him the bike to ride to get him home.

“However, he didn’t get very far because he was stopped for taking the bike without consent.”

Chairman of the bench Monica Arthur sentenced him to a six-month community order with supervision, ordered him to attend a 20-day thinking skills programme and excluded him from Sainsbury’s, in Murray Street for six months.