An off-duty police officer in Florida jumped into the ocean to pull a boogie-boarding boy to safety after a shark was spotted swimming toward the child in a heart-pounding video.

Cocoa Beach Police Officer Adrian Kosicki was walking along the beach with his wife on Thursday when they noticed a shark approaching the boy in the shallows just offshore, police wrote on Facebook.

SHARK 'GRABBED' 10-YEAR-OLD BOY FROM BOAT IN TASMANIA: REPORT

Police shared a bystander’s video showing a shark fin cutting through the water’s surface as it swims toward the boy.

“Hey buddy! Hey, there's a shark right there," an onlooker says before another shouts, "There he is!"

Police said the shark, pictured right, swam within feet of Kosicki and the boy as they safely reached the shore, pictured left.

Police said the shark, pictured right, swam within feet of Kosicki and the boy as they safely reached the shore, pictured left. (Cocoa Beach Police & Fire)

The quick-thinking Kosicki jumped into the water and grabbed hold of the boy, dragging him through the surf toward shore as the shark swam “dangerously close,” police said. Kosicki and the boy reached the safety of the beach as the shark swam within just feet of them, according to the video.

The species of shark wasn’t immediately clear.

“We’re certainly not marine biologists, educated and trained to differentiate between the various species of sharks, their respective feeding habits and aggressiveness near swimmers,” police wrote. “We just do what we do best — protect the public from harm.”

BOY, 16, SURVIVES SHARK ATTACK IN NORTH CAROLINA WITH HELP FROM DAD

Florida sees the most shark attacks during the months of July, August, September and October, when the water temperature rises and human activity increases in the waters, the Brevard Times reported.

Brevard County, where Cocoa Beach is located, has Florida’s second highest number of shark attacks behind Volusia County, according to the paper. Volusia County, home to Daytona Beach and New Smyrna Beach, is known as the shark bite capital of the world.

CLICK HERE TO GET THE FOX NEWS APP

“Thanks to Adrian, we’ll never know what that shark’s intentions were, and that little boy will forever have a pretty cool story to tell,” police said. “Great job!”