A burglar who was confronted by a householder as he tried to climb through a window in the middle of the night has walked free from court.

Kevin Clear told police "I want to go back to prison'" when he was caught trying to break into his third house in just over a week.

But the 42-year-old who has a record dating back a quarter of a century with a dozen burglaries escaped being returned to prison.

Instead a judge at Swindon crown court imposed an 18 month community order and told him to attend a think first programme.

Clear was put on a deferred sentence in May to see if he could stay out of trouble for five months, tackle his drink and drug problems and receive help for his mental health.

He was caught after he tried to break into a house on Ermin Street shortly after 4am on Sunday January 7.

The householder had gone to bed shortly after midnight and was woken by a scuffing sound coming from an open window.

He looked across to see a face at the window, which was over a downstairs bay front, and an arm reaching into the bedroom.

The householder got out of bed and went to the window to see the would-be intruder running away across the garden.

He called the police and gave them a description of the man he had seen and Clear was arrested nearby soon after having been tracked by a dog handler.

As he was arrested he said I want to go back to prison. I have spent 27 years inside. I can't handle it outside. I just saw the open window and tired to get in. I just want to go back to prison'.

When he was questioned he not only admitted the break in but also said he burgled two other houses the previous week.

On Saturday December 30 last year he broke into a house on Bunce Road and on Tuesday January 2 he broke into another property on Ermin Street.

Clear, of Frank Warman Court, Ermin Street, pleaded guilty to one count of attempted burglary and asked for two burglaries to be taken into consideration.

The court was told he had a long history of offending going back to 1980 with 12 previous counts of burglary He was released from prison in March 2004 having been jailed for five years in 2001 for burglary.

Rob Ross, defending, told an earlier hearing his client had a history of drink and drug abuse as well as going in and out of prison.

But he pointed out that apart from the three incidents in eight days he had not offended since he was last released from prison.

And he said during the six months since the deferment his client had been moving forward very, very well'.

Passing sentence Recorder Neil Ford QC said "You know by the way you have been treated by the courts in the past that the courts view burglary and attempted burglary very seriously and you have received five years for it before.

"This case is in my view an exceptional on and your personal circumstances are also exceptional. You have been making real progress."