Charlie Fry, 25, was at a beach north of Sydney on Monday when the shark “jumped out of the water and hit him in the right shoulder”, police said.
Mr Fry said he punched the shark while in the water before climbing back on his board and surfing to shore.
He said he had been inspired by surfer Mick Fanning, who famously fended off a shark during a competition in 2015.
The shark left scratches and a small puncture wound on Mr Fry’s arm. Police said the animal was about 2m (6.5ft) long.
“When it happened, I was like, ‘just do what Mick did, just punch it in the nose,'” he said.
He described the contact as “a massive thud on my right-hand side, which completely blindsided me”. He said he feared for his life during the incident, which happened near shore at Avoca Beach.
A helicopter rescue service photographed what is said was most likely a bronze whaler shark nearby shortly afterwards.
The beach was closed on Tuesday, council authorities said.