A hapless shop raider was found lying nearby in a pool of blood after sustaining a serious leg injury clambering through the window he broke to get in.
Dopey William Gillilan, 42, was caught red-handed still clutching the till he had taken during the raid when medics and police turned up to help him.
Officers then found a clear trail of blood leading back to Willows Coffee Shop where Gillilan had broken in just a few minutes earlier.
He had avoided setting off the alarm sensors by ducking and creeping across the café floor – but was clearly visible doing so on the in-house CCTV footage.
Perth Sheriff Court was told on Thursday that Gillilan carried out the bungled robbery while he was on licence having been freed early from a previous jail term.
Gillilan, Skinnergate, Perth, admitted breaking into Willows in Perth on 16 December last year and stealing a till and £150 cash.
He also admitted using a screwdriver to break a car window with intent to rob it on the same day, and breaking into a works van and stealing £700 worth of gear the day before.
Fiscal depute Michael Sweeney told the court: “Police were contacted by the ambulance service to attend a male suffering from a serious leg injury.
“The ambulance service were with the accused. He was in possession of the cash register and there was a trail of blood leading directly to Willows.
“Police observed a smashed glass panel and a substantial amount of blood directly next to it. CCTV showed him standing outside with a large paving slab.
“He is then seen to enter the premises. He is seen creeping in slowly and bent over. He stands up fully and walks behind the counter to the till area.
“He has avoided triggering the alarms by the way he creeps in and ducks down to avoid the sensors. He goes behind the counter, removes the till and leaves.”
Mr Sweeney said Gillilan failed to get away with anything from the works van either as he had stashed the goods nearby and they were found by the owner.
“He said he could not remember anything because he was on drugs at the time,” the prosecutor told the court.
Sentence was deferred for reports and Gillilan was remanded in custody.