It could easily be a slapstick routine by a criminally-minded Mr Bean, but it’s actually a real life attempted robbery that turned into a farce when a thief got stuck in the railings of the shop he had just tried to rob.

The incident took place in the Peruvian capital of Lima and was captured on camera by an onlooker in the Comas area of the city.

As the video shows, the bungling thief got trapped coming out of and through the railings of the shop he had attempted to loot, while his armed companion works to help free him.

The footage shows how, upon trying to exit the store, the alleged thief tried to squeeze through a small square in the railed gate of the shop. Whether he’d forgotten to look in the mirror that morning or is just bad at estimating sizes, it turned out he had a hard time fitting through it.

The video shows how he manages to squeeze his legs through the small gap, but then gets stuck trying to pull his torso through.

What makes it even more unbearable – and kind of Mr Bean-like – is that there are whole bunch of people still inside the shop at the time. In a desperate attempt to keep them in order while his friend and co-conspirator tries to break free, the thief’s companion threatens everybody inside with the gun.

It was the second major fail of their attempted crime, as the workers at the store – an internet café and shop – had initially been overpowered by the workers there and forced to leave empty-handed.

One of the thieves allegedly attempted to fire his pistol, only for it to jam. That’s when the pair tried to run away, only one for one of them to get stuck in the railings.

Nevertheless, the pair eventually escaped. Reports indicate that one of the shop workers received an injury to his head and was hospitalised. An investigation into the incident has been launched, but no arrests have been made as yet. The shame of their failure is almost enough punishment though.