A bungling burglar who was stuck head-first for six hours after trying to get into a pub through a metal shaft was today warned he was one step away from being put behind prison bars.

Drug addict David Gardner was only rescued when an early-morning delivery man heard shouting from somewhere around the pub and tracked the voice down to the ventilation shaft.

Firemen then had to winch him clear in a delicate operation but no sooner had he been freed than he was arrested by police on suspicion of burglary.

Newcastle Magistrates Court today heard how the 28-year-old climbed on to the roof of the Twin Farms pub, in Newcastle, in the dead of night and lowered himself down the shaft.

Gardner, a heroin addict, of Newbiggin Hall, Newcastle, who had been drinking at the pub before the attempt to burgle it, in March this year, had admitted burglary with intent at an earlier hearing.

Today, after magistrates read reports, Gardner's solicitor Peter Docherty made no plea in mitigation.

At the previous hearing, Mr Docherty had told magistrates: ''I think he must have been watching Bruce Willis in Die Hard to think he could get into the building through a ventilation shaft, commit a burglary and then actually get away with it.

''It was a thoroughly incompetent attempt at burglary - how did he think he was going to succeed?''.

Gardner was today given a 12-month Drug Treatment and Testing Order and warned he faced prison if he did not comply with it.

Bench chairman Edward Luck told Gardner: ''This is a chance for you to get rid of this terrible habit you have and possibly the final chance you will get.

''Any breach of the order will result in a sentence of a different kind and I'm sure you are aware of what that will be. ''It was a very silly attempt at a crime and you risked the lives of firefighters as well as yourself.''