A bungling burglar who fled two homes – once after his spade set off an alarm and then when he was spotted dangling from an upstairs window- has been jailed.

Gareth Farrington, who bungled both burglaries in Impington, was sent to prison for three years.

PC Gareth Tanner said: “This case shows that if you commit burglaries you are likely to be caught and sent to jail.

“A relatively cheap security measure prevented him from getting into the first property and forensic work gave us the evidence we needed to bring him to justice.

“I would urge residents to review their home security because it might stop a burglar in their tracks.”

Farrington, 27, of Hanson Court, Cambridge, broke into a garden shed at a home in The Dole between 6.30pm on September 4 and 11am the following day.

He grabbed a spade which he used to try to force open the kitchen window. However, the owner had fitted their ground-floor windows with alarms which sounded and Farrington fled empty-handed.

At about 2pm on September 5, he broke into a house in Hereward Close and gathered items to steal using a pair of his socks as makeshift gloves.

But the victim returned home and saw Farrington hanging from an upstairs window. She challenged him and he jumped down and made off on a bike.

As he jumped, one of the socks got caught in the window frame and he was forced to leave it behind.

Farrington was arrested and denied the offences but DNA had been retrieved from the sock and he later pleaded guilty to the Hereward Close offence and asked for the other to be taken into consideration.

On Wednesday he was sentenced to three years in prison for the burglary and a breach of an anti-social behaviour order (ASBO).

The sentencing coincides with a police campaign urging homeowners to be security conscious this Christmas.

Last December, about one in six burglaries in the county were at properties where the residents had been away for two days or more.