A diver has had an extraordinary escape after a large shark believed to be a great white broke into his shark cage before jumping out through the top, leaving him unharmed.

The footage, shot off the coast of Mexico, shows two men on a boat luring the shark close to the diving cage with a chunk of meat.

But things went horribly wrong when the shark somehow managed to burst into the cage, thrashing around until it managed to heave itself out through the open top.

Concerned spectators rushed away to find a snorkel mask to see if the diver was harmed, when he surfaced and shakily climbed onto the boat.

The man who filmed the video said in a post on Facebook that the shark was a Great White, and that no-one was hurt.

"Great White sharks are awesome and what appears to be an 'attack' on a diving cage is not," he said.

"They are temporarily blinded when they open their mouths, so when the shark went for the tuna bait on the rope it accidentally slammed into the cage.

"They can't swim backwards so it thrust forward through the cage with a diver inside.

"Rest assured, no-one was injured and after a dramatic half minute, the diver emerged safely."