A swimmer off the coast of the Maldives nearly collided with a nearby shark and the close call was caught on camera by a witness.

The video, posted to Facebook by Sergey Sverdlov, shows Dmitry Zhadan swimming toward a boat when a shape appears in the water in front of him.

The object soon reveals itself as a nurse shark, leading Sverdlov to shout out a warning and point at the approaching fish.

Zhadan, who appeared to be approaching a head-on collision with the shark, stops moving forward and shouts in apparent panic.

The shark appears to have little interest in the man and swims away as voices on the boat can be heard laughing.

Nurse sharks are slow-moving and are rarely blamed for attacks on humans.