A group of kayakers captured their heart-pounding close encounter with a hammerhead shark off the San Diego coast Saturday — a sighting that prompted lifeguards to close down crowded beaches nearby.

Their incredible video shows the 8- to 10-foot shark circling and swimming under the watercraft off La Jolla Shores. Stalking the kayakers, the hammerhead followed them back to the beach as they paddled away, according to San Diego Lifeguards.

When officials saw the footage and noted the shark was exhibiting "aggressive behavior," they took immediate action.

They decided to clear the waters between La Jolla Cove and Scripps Pier, announcing the closure over loud speakers to thousands packed onto the sand. The beach will be closed for the rest of the day, according to Lifeguard Lt. Andy Lerum.

Beaches in La Jolla were closed Saturday after a group of kayakers caught video of a hammerhead shark circling their boat not far from shore. NBC 7’s Liberty Zabala and NBC 7’s Omari Flemming report.

"What we're going to do is evaluate tomorrow morning," he said at a news briefing Saturday afternoon. "If there's no other shark sighting by then, we'll probably lift the closure and open it as an advisory for the full 24-hour period."

People swimming near the shark were able to climb onto other kayaks and get safely to shore.

The animal was last seen just outside the surf line at the foot of Avenida De La Playa, at the south part of La Jolla Shores.

Lifeguard crews in boats and a helicopter soon began searching the waters for shark, but no more sightings have been reported. Officials say if they find it, they will track it and make sure it leaves the area before the waters are reopened.

The closure was a disappointment to many beachgoers, who sought the cool water on the unusually hot Saturday.

"They were just going to shut it down temporarily, but then they decided to shut it down for the entire day," said Gil Durazo, at La Jolla with his two sons. "So we kind of stuck it out for a little while but then decided, you know, we've been here long enough, we're just going to head home and jump in the pool for a little while."

Lifeguards say they brought the kayakers' footage to Dr. Andy Nosal, a marine biologist at Scripps Institute of Oceanography. He said based on the size, species and behavior of the shark, lifeguards were right to close the beach.

"It's not uncommon for these types of sharks to be seen far off shore, but it's uncommon to see it so close to a popular beach like La Jolla Shores," said Lerum.

According to the lieutenant, a similar closure happened in La Jolla a couple years ago when a great white shark came concerningly close to the shore.

As for why the hammerhead was acting aggressively toward the kayakers, Lerum's best guess is food.

"Well sharks are very instinctive," he said. "Usually what causes them to act aggressively is their desire to eat, and so there may have been food in the area that we don't know of." He was not sure if the kayakers had fish on board.

Hammerheads rarely present a threat to humans, experts say. In fact, since scientists began keeping records in the 1950s, there have been just 32 documented hammerhead shark attacks, according to Mike Price, an assistant curator of fishes at SeaWorld.

However, a hammerhead bit into a local diver's hand earlier this month about 100 miles off San Diego's coast.

instagram.com/p/6