A robber who boasted about plans for an armed robbery on Facebook has been jailed for four years.
Andrew Hennells posted a comment on the social networking site reading "Doing. Tesco. Over" at 7.25pm on February 13.
Fifteen minutes later Norfolk Police were alerted by a member of the public to a man demanding cash at a branch of the store in King's Lynn.
Sentencing him for armed robbery at Norwich Crown Court today, judge Anthony Bate said Hennells posed a "high risk of serious harm to the public".
The court heard armed police were deployed after the alarm was raised.
Hennells had escaped after stealing a car belonging to a retired couple who had stopped to use a cashpoint.
But officers tracked him down in a nearby pub. He was carrying a knife and £410 in stolen cash.
The 31-year-old, of Riverview Way, Gaywood, admitted robbery and carrying a knife as an offence weapon at an earlier hearing. Another count of robbery relating to the car-jacking was left to lie on file, Norfolk Police said.
Outside court, Sgt Pete Jessop, from King's Lynn CID, said that the Facebook confession made it easier to prove the case.
Mr Jessop added: "This case is a stark reminder that crime doesn't pay; the victims found themselves being threatened at knifepoint while going about their business and the offender, as a result of poor decision making, now finds himself behind bars for four years."
Commenting on the Facebook posts, he said that while these did not help to solve the case it did confirm the timeline of events.
"What did help us in this case was information provided by the public which allowed us to swiftly detain the suspect, safely resolving the incident," he said.