Liam McInerney, 44, of Romford Road in Forest Gate, was stealing from Greggs in Bishopsgate on November 9 last year when an off-duty officer intervened, court records state.
The officer was spat at and punched in the face by McInerney.
The offender later pleaded guilty to common assault and theft from a shop.
Last Tuesday (February 18) he appeared at City of London Magistrates’ Court where he was sentenced to 18 weeks in prison.
He was also ordered to pay £200 compensation.
The Bishopsgate bakery sits close to Liverpool Street train station.