A great white shark washed ashore on a beach in Chatham, Mass. on Monday. YouTube videos show how the shark was dramatically rescued by beachgoers, who kept throwing water on the creature in an attempt to keep it alive until a rescue crew arrived, according to The Washington Post.

"The shark was stuck there for a while in the sand, so then people got buckets and were trying keep it wet so it could continue to breathe," said eyewitness Isabelle Hegland.

"I was a little afraid but I could tell it wasn't moving anytime soon because the shore was going way out, it was approaching towards low tide so it was becoming increasingly difficult for the shark to keep its gills wet and be able to breathe," she said, CBS Local reported.

The 7-foot male shark got stranded on the Cape Cod beach as the tide went out and was kept alive until rescue officials attached a lone to its rear caudal fin and pulled it back into the ocean using a boat, according to Fox News.

"Still alive but very sluggish, barely moving, so we put a tag on it and then resuscitated the shark by putting a bridle around it and with the harbormaster's help put it out into deeper water where we were able to resuscitate it and let it go," said Greg Skomal, who worked with the Atlantic White Shark Conservancy and the Chatham harbormaster on the rescue.

Skormal added that the bystanders on the beach were incredibly supportive during the initial rescue efforts. The Atlantic White Shark Conservancy posted YouTube videos on its Facebook page showing the rescue, according to The Boston Globe.