A novice surfer mastered a pro's move on the first try: He punched a shark on the nose to escape its jaws.

The attack Monday afternoon off the Australian coast left Charlie Fry with superficial puncture wounds on his right shoulder and upper arm.

A British doctor who arrived in Australia two months ago to work, Fry said Tuesday he had recently watched a YouTube video in which Australian professional surfer Mick Fanning described his famous escape from a great white shark during a surfing competition in 2015.

"So when it happened, I was like: 'Just do what Mick did. Just punch it in the nose,'" Fry told Nine Network television. "So Mick, if you're watching or listening, I owe you a beer. Thank you very much."

Fry, a surfing beginner, was surfing with three doctor friends when he was attacked off Avoca Beach, 90 kilometers (60 miles) north of Sydney

"I was out surfing and I got this massive thud on my right-hand side; it completely blindsided me," Fry said.

"I thought it was a friend goofing around. I turned and I saw this shark come out of the water and breach its head," he said.

"So I just punched it in the face with my left hand and then managed to scramble back on my board, shout at me friends and luckily a wave came, so I just sort of surfed the wave in," he added.

Fry said he wasn't conscious of his injured and bleeding arm until he reached the shore.

"I didn't really notice it at the time because when you're surfing, all I'm thinking was: 'I'm about to die. I'm literally about to die,'" Fry said.

"So I thought ... 'get in as fast as possible, ride the wave for as long as you can and then just start paddling for your life,'" he added.

Fry's friends drove him to Gosford Hospital, where they all worked, to be treated. The beach was closed for 24 hours.

Lifeguards spotted the 3-meter (10-foot) shark that attacked Fry close to shore and would use drones on Tuesday to check that it had left the area, Australian Broadcasting Corp. reported.

Fry said he could not return to the ocean for a week due to his injuries, but "after then, I'll be racing to get back in."

Fanning was competing at the J-Bay Open in South Africa two years ago when he was knocked off his board by a shark yet escaped unscathed. The video of the attack and Fanning speaking about it has been viewed more than 24 million times on YouTube.