A man stole a policeman’s wallet from his car - when the officer left it to pursue a shop thief.
Calvin Smith, of Moorside Avenue in Crosland Moor, reached in through the open window and grabbed the wallet.
He later led the officer’s colleagues to the place where he had ditched it.
Smith, 28, pleaded guilty at Kirklees Magistrates Court to theft from a motor vehicle.
Robert Campbell, prosecuting, said that the incident happened on July 27.
Pc Daniel Broderick received a report over his radio about a shop theft.
He parked up his police car and gave chase to the suspect.
Mr Campbell said: “He hadn’t wound the window up and the defendant saw his wallet on the central console having walked past.
“He put his hand in and took the wallet.”
Smith removed £20 from the wallet, which also contained credit cards, the officer’s driving licence and his warrant card.
He then abandoned the wallet in a rubbish bin behind some shops.
Mr Campbell said: “Some other people parked in their vehicles saw this and called police.
“They found him in the town centre and he took police to where the wallet had been discarded.”
Ian Whiteley, mitigating, said that all of the stolen items have been returned.
He added: “One would question why a police officer would leave the window open with the wallet in it.
“The opportunity was there and Mr Smith took it.”
Magistrates heard that Smith had started using heroin at the age of 12.
The offence may have been motivated by his drugs use, magistrates heard.
They gave him a community order with nine months of drugs treatment.
Smith must also pay £50 fine and pay £85 costs and £60 victim surcharge.