An armed robber boasted on Facebook about his plans to raid a supermarket minutes before he was stopped by armed police.
Andrew Hennells, 32, posted a comment on his profile which read: "Doing. Tesco. Over" at 19:25 GMT on 13 February.
Just 15 minutes later, after he had held up the King's Lynn store, police caught Hennells with a knife and £410.
He admitted robbery at Norwich Crown Court.
A member of the public had reported seeing a man demanding cash at the Tesco store before he fled to a nearby pub, Norfolk Police said.
Sgt Pete Jessop said Hennells's Facebook confession had made it easier to secure a guilty plea.
"It was a bizarre and unusual case," he said. "The pictures and posts on Facebook helped us confirm what we already knew.
"None of this takes away from the seriousness of the crime or the trauma experienced by the victims of the robbery."
Hennells, of Riverview Way, Gaywood, Norfolk, also admitted carrying a knife as an offensive weapon.
He is due to be sentenced on 8 April.