A man used his surfboard to fend off a shark that bit him on his calf off an Australian beach two days after a fatal attack on the Great Barrier Reef.

Lee Jonsson, a 43-year-old teacher aide, was bitten on Wednesday at Shelly Beach off Ballina in New South Wales state. Japanese surfer Tadashi Nakahara died at the same beach in 2015 after a great white shark 3 to 4 metres (10 to 13 feet) long tore off both his legs.

Government shark experts measured the tooth imprints in Jonsson's surfboard and concluded a juvenile great white shark 2.6 metres long was responsible.

David Wright, mayor of Ballina Shire, said Mr Jonsson came ashore after he was bitten while lying on his board, wrapped his leg and went to the hospital for treatment of a 20-centimeter (8-inch) wound.

"It dragged him off and he fought the shark with his board," Mr Wright said. "It's one of those unfortunate things."

Beaches in the area are expected to be closed for at least 24 hours.