An American marine biologist says footage of her swimming with a humpback whale shows the large mammal protecting her from a tiger shark.

Nan Hauser, 63, president of the Center for Cetacean Research and Conservation and a Brunswick, Maine, resident, says she uploaded footage of her encounter Monday and it quickly spread across the internet.

Hauser tells the Portland Press Herald she was in the Cook Islands in the South Pacific Ocean when she came face-to-face with a 23-tonne humpback whale, which approached her and began nudging her around the water. She says the whale also shielded her with a fin and even lifted her out of the water on one occasion.

She says after the encounter, she noticed a tiger shark was swimming nearby.

Hauser says whales are "altruistic" and often hide seals from predators, but she has never experienced or read about anything like this before.