A diver with the Australian navy fought off a shark after he was attacked in Sydney Harbor while taking part in anti-terror drills.

The 31-year-old elite diver, who was not identified, punched the shark twice as he tried to ward it off.

He was swimming on the surface of the water in Woolloomoolloo Bay near the naval headquarters at Garden Island with a fellow diver just before 7 a.m. when the attack occurred.

Moments before the attack, he reportedly saw a large dark shape beneath him.

The shark disappeared after being punched, leaving the diver with severe wounds to his right hand and thigh.

He was dragged onboard a small navy boat nearby and administered first aid. Rescuers said that despite the severity of his wounds he was conscious and in "good humor."

Click here to read the full story from News.com.au.