Two divers have captured the moment the world's largest fish swam past them during a dive off West Palm Beach in Florida.

Brittany and Keith Brock spotted the whale shark at a local diving spot.

Posting the video to YouTube, they wrote: "At the end of our dive on the dive site known as 'The Trench' off of West Palm Beach, Florida we had the encounter of a lifetime!

"My wife, Brittany, our niece Addie, and our Dive Guide Craig Buss from Pura Vida Divers were the last 4 divers in the water ascending from approximately 60'.

"This whale shark graced us with its presence for approximately 1 minute, in approximately 30 feet of water, surrounded by nearly 100 remoras and 20+ cobias."

The whale shark is a marine giant that can grow up to 40 feet long and weight up to 20 tonnes. Found in tropical oceans, they are feed plankton, krill and other small animals. Despite their enormous size, they are harmless to humans.

The mouth of a whale shark is nearly five feet wide, which allows the animal to filter large quantities of plankton as it swims.

Although the exact number of whale sharks in the world is unknown, the species is classified as endangered by the International Union for Conservation of Nature (IUCN). This is largely due to the impact of fishing and vessel strikes, as well as the animal's long life span and late maturation.

Whale shark
The whale shark was spotted off West Palm Beach in FloridaStoryful/kbscubadiver