A burglar called 999 for help after he got stuck in a window while breaking into a property in Swindon.
Frederick Moulton, 53, was left hanging upside down after getting his leg jammed at the empty home on Groundwell Road, in the early hours of Thursday.
After failing to free himself he was forced to call emergency services for help.
Firefighters arrived to find him stuck and then alerted police officers who arrested him when he was brought down.
Wiltshire Police said in a statement: “While trying to climb in through a window his leg became jammed leaving him hanging upside down inside.
“As a result, he was forced to call the fire service asking to be freed.
“Dorset and Wiltshire Fire and Rescue Service called us and our officers arrived at the address with fire brigade colleagues.
“On arrival it was obvious that Frederick Moulton was trying to break-in and so was arrested at the scene.”
Moulton, from Spring Close, Swindon, pleaded guilty to burglary and possession of Class B drug amphetamine at Swindon's Magistrates Court on Friday morning and was given an 18-month community order.
He must comply with certain requirements including attending rehabilitation appointments.
Moulton must also pay a victim surcharge of £95 and court costs of £85.