In shark school, they're supposed to teach you to keep an eye on your immediate surroundings when you're chasing a seagull. But it seems somebody mustn't have been paying attention that day.

Beachgoers in Chatham, Massachusetts, got the shock of their lives this week when this 2-metre-long great white shark managed to get itself stranded on a sandbar as the tide went out. According to reports, the juvenile male shark had been trying to catch a seagull, but found itself in some serious trouble as the shore receded, leaving it beached in a shallow puddle on the sand.

"There was no way for the shark to get to where it could swim, so it just kept flapping and moving over," eyewitness Kelly Skanell told local news outlet WCVB Boston.

Luckily for the shark, beachgoers at the scene kept the animal alive by dousing it with buckets of water until marine officials turned up, all the while keeping a safe distance from its gaping maw.

"What we did once it was completely beached is throw buckets of water, because we though that would sort of help keep it alive," said Isabel Hegland, another witness to the incident.

According to Greg Skomal, a marine biologist who was involved with the rescue, the beachgoers did the right thing, as tossing water on a beached shark's body will keep its tissues alive and gills pumping, enabling the animal to keep breathing, at least for a short time.

"The shark was at the wrong place at the wrong time and ended up high and dry," he told Greta Weber of National Geographic.

When the harbour master arrived, he and his team attached a line to the shark's rear caudal fin and towed the animal safely out into the water. The shark was also tagged by Skomal with a tracking device before being released.

According to reports, the animal appeared to be doing well once back in the water and had seemingly recovered from its ordeal. Once information is recovered from the tracking device, we'll know more about the extent of the injuries it sustained injuries during the event.

The seagull did not respond to immediate requests for comment.