A drunken burglar caught snacking from a fridge was driven out of the flat by the owner hitting him with a dog lead.
Liam Cryer, 31, of Berry Avenue, Paignton, broke into a flat in Newton Abbot while the 75-year-old owner was asleep on 7 January.
The pensioner ejected Cryer by hitting him with the lead, after discovering the intrusion at about 03:40 BST.
Cryer admitted burglary and was jailed for six months by Judge Peter Johnson at Exeter Crown Court.
Cryer had eaten or stolen sweets, a custard cream biscuit, cake, which he washed down with a fizzy drink after also taking an indigestion tablet.
On tagged curfew
After being caught and struck several times, Cryer apologised and left the flat through the backdoor, the court was told.
He was traced by police using a fingerprint from a windowsill and local CCTV footage.
Cryer informed police he had hidden in the flat after running away from a group of people he said were trying to attack him.
At the time, he was on a tagged curfew for public order offences and was not allowed outside of his home at night.
'Got a few whacks'
Judge Johnson said: "You told the police it was an honest mistake. It was a mistake, but it was not honest.
"The aggravating features are that you were under the influence of alcohol and were subject to a community order and should not even have been out at night."
Kevin Hopper, defending, said Cryer was "was clearly in drink" when he "helped himself to some custard creams".
He added: "He was disturbed and got a few whacks with the dog lead. Some may say he was lucky to only get three."