A pair of divers have filmed the heart-stopping moment they encountered a great white shark while swimming just metres from the shore.

Ryan and his friend were hunting for fish with his spear 30 metres off the coast of Flynn’s Beach in Port Macquarie, New South Wales, Australia, when they noticed a dark shape in the water.

With Ryan's head camera filming everything, the true nature of what the figure was soon became apparent.

In the clip, a great white shark is seen lurking several feet from where Ryan is swimming with his spear.

He immediately screams at his friend to alert him of the danger and the pair swim to the nearest piece of land to get out of the water.

Have you had any scary shark encounters? Let us know in the comments section below

The great white shark lurking near Ryan
The great white shark lurking near Ryan

“We came down here on Sunday afternoon looking for dinner and almost ended up as dinner,” he later told PRIME7 News North Coast.

“By the time I got back into the water, the shark was coming right at me from the other direction behind me.

“So I just spun my gun around and pointed at its nose and then, at the last moment, he turned and disappeared.”

His friend admitted the experience won’t stop them returning to the water.

“That’s their home, it is what it is and we’re taking that risk every time we go in but we’ll just leave them alone,” he said.

Stock image of a great white shark breaching the water
Stock image of a great white shark breaching the water

The incident comes just a week after surfer Chantelle Doyle was mauled by a juvenile great white shark off Shelly Beach, which is also in Port Macquarie.

But her hero husband Mark Rapley managed to save her from an even more serious attack.

He repeatedly punched the shark as it clamped its jaws around Chantelle’s leg before it eventually let go.

Footage also recently surfaced of the heart-stopping moment a huge 14ft great white managed to sneak up on a completely unaware diver.