An Australian man has been hailed a "hero" after repeatedly punching a shark until it released his wife's leg.

Police said the couple were surfing at a beach near Port Macquarie, four hours north of Sydney, yesterday morning when she was bitten twice and injured on her right leg.

"Her companion was forced to punch the fish until it let go," police said in the statement.

Paramedics treated the 35-year-old at the beach before she was later airlifted to a major hospital for surgery.

One witness who was surfing nearby when the attack occurred called the man a "hero" for taking on what appeared to be a great white shark up to three metres long.

"He started laying into the shark because it wouldn't let go," Jed Toohey told the Daily Telegraph.

"He saved her life... He was really incredible."

The woman's husband, Mark Rapley, played down his efforts, telling the newspaper he "did what anyone would have done in that moment".

Australia has one of the world's highest incidences of shark attacks and there have been five fatal ones in the country so far this year.

Last month, a shark pulled a 10-year-old boy from a fishing boat off Tasmania.

He survived after his father jumped in the water to save him.