Security cameras recorded a thief stealing goods from a Hartlepool shop.
And as police were looking at the footage, the criminal was spotted leaving the same store again with stolen items.
Officers gave chase and caught Karl James Cain, 35, in possession of coffee, lemon juice, and a silver foil wrap.
Prosecuting David Maddison told Hartlepool Magistrates’ Court: “It was June 7 at 9pm when the defendant went into Sainsbury’s store in Murray Street and stole three jars of coffee. He was caught on CCTV. The following day around 6pm, officers were in the store viewing the CCTV when they saw Cain leaving the store via live CCTV footage.
“They followed him out and after a short chase he was caught and was found in possession of a silver foil wrap, two jars of coffee and a bottle of lemon juice. The theft of those items were caught on the CCTV as well.”
He added: “In police interview he said he’d stolen them with the intention of selling them. He said he’d sold the coffee which he’d obtained on June 7, for £10. The coffee and lemon juice he’d stolen on June 8 were recovered.”
Cain, previously of Whitby Street, in Hartlepool, but now of Canon Cockin Street, Sunderland, pleaded guilty to two counts of theft and one of possession of diamorphine.
Defending John Relton said his client has a “lengthy history” of similar offences.
He also told the bench that despite Cain’s lifestyle he had not had any intervention or help since February last year.
Mr Relton said: “My client was released from custody on May 15 and he sought to obtain benefits. He is yet to receive any form of money from them.
“He’s been staying with friends at the address in Sunderland, which was given to the court today. He came to Hartlepool to Whitby Street to a church which offers accommodation to homeless people.
“There was no space left there for him and he was left to fend for himself hence the theft of coffee. It is sad.”
Chairman of the bench Martin Slimmings adjourned sentencing and sent the case to Peterlee Magistrates’ Court to link up with another matter on June 19.