Professional surfer Matt Wilkinson has a lucky escape with a great white shark after a drone captured the moment he came within inches of being attacked off the coast of Ballina in northern New South Wales.

Wilkinson can be seen paddling on his board as a dark shadow emerges below him, circling around the world championship tour surfer before quickly swimming behind his feet.

The shark, which was estimated to be about 2.5 metres long and appeared to be a great white, then surged towards Wilkinson, before changing its mind at the last moment and swimming away, leaving Wilkinson unscathed.

“I heard a splash and a noise and looked around and couldn’t see anything,” Wilkinson said in a statement from Surf Life Saving NSW.

The drone was operated by Surf Life Saving and they were able to broadcast a message to Wilkinson from the aircraft’s speakers, which warned him to return to the shore as there was a shark in the waters.

“The drone came down and told me that there was a dangerous shark in the area, return to the beach,” Wilkinson said.

“I got to the shore feeling a bit weird and the lifeguards showed me the footage and I realised how close it came without knowing it was there. It looks like it’s going for my leg and it’s changed its mind.

“I’ve been surfing with sharks my whole life and I understand they’re there and know enough about them to know they have not too much interest in humans. I’m just glad today the shark reconsidered at the last second,” Wilkinson said.

The 32-year-old Australian was also competing five years ago when fellow competitor Mick Fanning was attacked by a shark in South Africa, which was captured live during the Johannesburg Open.

Wilkinson spotted a similarity between his near-miss and Fanning’s attack, and he revealed how his wife reacted when she learned of the incident.

“I feel grateful and pretty weird at the same time but happy it decided not to go me,” Wilkinson added.

“When I saw the footage I saw the similarities, like, I had a yellow leg rope on and Mick’s board was yellow is what I was thinking about when I came in.

“I called my wife because I didn’t want her to see the footage before I saw it. She doesn’t want me surfing for a couple of days now.”

Drones are becoming an increasingly common factor in keeping humans safe from shark attacks, with a number of beaches using them as cost-efficient methods to keep surfers and swimmers safe, with measures in place to shut beaches if sharks are spotted in the area.

Beau Monks, who was operating the drone that captured Wilkinson’s near-miss, ecalled how quickly the incident played out on his monitor, and believes that the noise of the drone may have played a factor in scaring the shark off before it could attack the surfer.

“It sort of came out of nowhere, then went right up to Matt. It moved pretty fast. I was tracking it and notified the lifeguards and used the speaker on the drone to get everyone out of the water,” Monks told ABC.

“Within 10 seconds it was at the surfer and five seconds later it was gone.

“I’m not entirely sure why the shark decided to turn away at the last minute. It could have been something as simple as just bumping into his leg rope, or it might have been the drone. Marine creatures have been known to dart away when the drone does come over,” he said.