A man attacked by a small shark swam 300 metres, walked to his car and drove to a local surf club to get help while the shark was still attached to his leg.

The wobbegong, or so-called carpet shark, attacked 22-year-old Luke Tresoglavic yesterday as he was snorkelling on a reef off Caves Beach, south of Newcastle.

Mr Tresoglavic said today that when the 60 centimetre shark attacked him, he "instantly grabbed hold of it with both hands as hard as I could to stop it shaking".

"I just realised I had to swim in like that, hanging on to it," he told ABC radio.

"Once I got on to shore, a couple of people tried to help me but I could not remove it, it was stuck there.