Four New Zealand lifeguards say a pod of dolphins provided a protective barrier around them when they were threatened by a great white shark.

Rob Howes and three other lifeguards were on a training swim about 100 metres off shore at Ocean Beach on NZ's north-eastern coast when the dolphins raced in and herded the swimmers together.

"They started to herd us up, they pushed all four of us together by doing tight circles around us," Howe said.

When he tried to drift away from the group, two of the bigger dolphins herded him back.

He then saw why. A three-metre great white shark was cruising toward the group about two metres below the surface.

"I just recoiled," Howe said. "It was only about two metres away from me. The water was crystal clear and it was as clear as the nose on my face."

Howe says he then realised the dolphins had moved in to protect the swimmers.

He says the dolphins surrounded the group for 40 minutes before they were able to make it back to shore.