A drunk burglar was caught on camera smashing his way in pub so he could have a lie down.
Leigh Boulton broke a window to get into the Robin Hood Inn, Pontefract, before lying on the floor for 20 minutes.
CCTV footage showed Boulton then get up and leave the premises without taking anything.
The bizarre break-in took place in the early hours of June 3 this year.
Bashir Ahmed, prosecuting, said the 38-year-old targeted the pub after closing time.
He put a sock over his hand before punching a window repeatedly until the alarm went off.
Boulton then left the scene and hid for 30 minutes before returning.
Read more: Dozy burglar fell asleep during break-in at Leeds elderly residents' complex
He managed to smash his way through the window to get inside.
Mr Ahmed said: "He lay on the floor for 20 minutes before he was seen on the footage to leave."
Boulton was arrested on July 19, a week after he broke into a house in Castleford,
Mr Ahmed said Boulton climbed through the kitchen window of a property on Smawthorne Road in the early hours of the morning.
He stole an Xbox and speakers worth £320 which he later sold at an exchange shop in Wakefield.
Read more: Thug jailed over shocking knife attack filmed by horrified witness in Wakefield street
Boulton was recognised from CCTV footage of him in the garden shortly before the break-in.
He tested positive for cocaine when he was arrested.
Boulton was interviewed about the pub burglary and said committed the offence "because he was intoxicated."
He pleaded guilty to two offences of burglary and was jailed for two years, four months.
Boulton, of no fixed address, has a history of committing burglary and thefts dating back to 2000.
James Littlehales, mitigating, said Boulton pleaded guilty to the offences at an early stage.