A shark thrashed its way into a cage whilst a diver was still inside.

The shark was seen biting on a line on the surface of the water before breaking a metal rail and entering the cage from the side.

Onlookers, who witnessed the incident off Guadalupe Island in Mexico, managed to open the top door as it wriggled around looking for a way out before its head popped out the top, according to Sky News.

The bloodied shark made its getaway and unbeknownst to onlookers, a diver who is shaken but unharmed, surfaces from inside the cage.

Footage of the rare breach has been posted on the YouTube.

A man said: ''These awesome sharks are biting at large chunks of tuna tied to a rope. When a great white shark lunges and bites something, it is temporarily blinded. They also cannot swim backwards so this shark lunged at the bait, accidentally hit the side of the cage, was most likely confused and not able to swim backwards. It thrust forward and broke the metal rail of the cage.''