An Australian surfer had a lucky escape from a potential shark attack thanks to a warning from a drone flying above the waves.

Amateur drone pilot Chrstopher Joye was flying his unmanned device over Werri Beach in New South Wales on Sunday, when he spotted a shark in the water heading towards the surfer.

Mr Joye used the speaker on his drone - a high-end search and rescue model - to alert the surfer to the danger.

They quickly turned their board towards land and began paddling in, while the shark swam back out to sea.

After the drone warning, the surfer paddled towards land while the shark swam in the opposite direction. Credit: Christopher Joye

“I was patrolling on Sunday and saw this large shark circling a surfer,” Mr Joye said.

“I raced in and blasted out the alert message, blaring, ‘Shark! Shark! Shark! Evacuate the water immediately!’

“You can see the surfer’s face as he suddenly looks up at the drone when he hears the message.

“He then sharply jerks the board toward the beach, which spooks the shark that was heading straight for him, probably thinking the surfer was unaware.”

He added: "I think it is probably the first time any drone pilot anywhere in the world has stopped a shark attack by warning the swimmers or surfers via a live communications channel."

Mr Joye, who is a hedge fund manager by day, spends much of his spare time patrolling the seas for sharks using his drone.

"I do it because I have seen so many sharks from the drone that someone has to try and keep our surfers and swimmers safe," he said.

"That’s why I bought the search and rescue drone with the ability to send alerts and communicate with people whose lives are at risk."

Sunday was the first time he had used his Mavic 2 Enterprise Dual, which cost around £3,300 (AU$6,000), to warn of a possible imminent attack.

Mr Joye believes the shark was three to four metres in length and probably “a bronze whaler or a young great white, both of which have many recorded human fatalities”.

He wants drone technology to be more widely used in preventing such attacks.

“The drone is much safer and more effective for sharks than a shark net,” he said.

There were 128 shark attacks in New South Wales between 1990 and 2017, including six fatal attacks, according to statistics compiled by – nearly twice as many as any other state in Australia.