A thief pinched lead from Calderdale Magistrates' Court building – just after being released from custody.
And he was spotted by the magistrate who had just dealt with his case.
Brian Marsden, 31, who had been living in a tent on moors above Heptonstall, was jailed for 56 days at Bradford Magistrates' Court.
He admitted theft, burglary and breaching
a conditional discharge for handling stolen goods.
Patrice Morris, prosecuting, said on July 12 Marsden appeared before magistrates after being arrested for failing to turn up at court two days earlier.
"He was released on bail," she said.
"A short time later one of the magistrates who had heard Marsden's case looked out of the window from the court building overlooking the car park.
"The magistrate saw Marsden with a piece of lead in his hand. He appeared to be picking the wall of the court and he was banging the lead on the pavement in an attempt to straighten or flatten it."
The magistrate went to court duties and later inspected the area where he had seen Marsden with the lead which was used as a lightning conductor.
"Six to seven feet of lead was missing from the edge of the building," said Mrs Morris.
The police were told and Marsden was later arrested when an officer saw him carrying a large box on Burnley Road, near King Cross, Halifax.
He admitted taking a several things, including a video camera and DVDs, from a garage in Sowerby Bridge.
Richard Brown, for Marsden, said he had been battling drug problems and had spent several months living in a tent.
He had committed the burglary with the intention of selling the goods to settle a debt and he stole the lead for drugs.
"He had been in custody overnight and needed to fund a drugs purchase," said Mr Brown.
He said Marsden was now co-operating with probation staff on a drug rehabilitation programme.
Bench chairman David Pearson said Marsden was a habitual burglar who was prepared to steal from anyone including the Crown.
The full article contains 348 words and appears in Hebden Bridge Times newspaper.