An underwater photographer had a close encounter with a 16-foot great white shark in the Stellwagen Bank National Marine Sanctuary off the coast of Massachusetts this week. The terrifying moment was caught on camera.

Photographer Keith Ellenbogen was free diving in the ocean, roughly 25 miles out from Boston, and was focused on a humpback whale swimming nearby when suddenly he saw the massive predator closing in on him.

Ellenbogen's venture was as part of photography of marine life for the National Oceanic and Atmospheric Administration. The project, titled "Space to Sea -- A Photographic Journey into Stellwagen Bank National Marine Sanctuary," is funded by the National Marine Sanctuary Foundation.

"In the distance, we see a fin breaking in the water; it’s one of those days you dream about it was calm," Ellenbogen said. "All of a sudden I dive in the water, I realize immediately it wasn’t a basking shark but a great white shark."

“I came so close that I was about an arm’s length away from the shark and it made this really strong eye contact that was unmistakable of a registration of knowing me and me knowing it and we just swam past each other in perfect harmony,” Ellenbogen told WBZ Boston.

The 360-degree video of 15-seconds was posted by Atlantic White Shark Conservancy on Facebook, garnering nearly 40,000 views as of Friday night.

Several shark enthusiasts reacted to the breath-taking moment captured by Ellenbogen.

"Didn't he hear the music when he was approaching?" one Facebook user asked.

"It is video footage like this that will help dispel the notion that these sharks are mindless maneaters. Instead we are starting to realize that they are curious and highly intelligent. That's a once in a lifetime experience where the shark was not baited and thus was super chill. Amazing footage!!" another wrote.

Great white sharks, which grow up to 20 feet long, are the largest predatory fish to roam the sea, according to National Geographic.

"Of the 100-plus annual shark attacks worldwide, fully one-third to one-half are attributable to great whites," National Geographic reports. "However, most of these are not fatal, and new research finds that great whites, who are naturally curious, are 'sample biting' then releasing their victims rather than preying on humans."

great white shark
Image showing a great white shark swiming past a diving cage in South Africa. Reuters