A Nelson diver has escaped a stingray attack with just three stitches and a hole in his wetsuit.

Joe McKnight, of Wakefield, was diving about 10m below the surface in Okiwi Bay, on the north-eastern side of Tasman Bay, on Saturday when the attack happened.

He told the Nelson Mail he felt a stab on his leg and looked down to see the one metre-wide stingray attached to him.

It remained attached for five seconds and when it pulled away there was a "squirt of blood".

Mr McKnight made his way to the surface and called to his friends who pulled him into the boat.

The Nelson Marlborough Rescue Helicopter flew him to Nelson Hospital and he was discharged two hours later.

Nelson Underwater Club president Eric Simmons said the incident was unusual.

"You have got to remember this is defensive behaviour, a stingray doesn't go out to attack."