An 8-foot bull shark attacked a 10-year-old surfer during a contest Sunday on Folly Beach, a competition official said.

But as the shark’s jaws snatched Tyson Royston’s surfboard, the Myrtle Beach boy escaped unscathed about 5:30 p.m. when he unhooked the leash connecting his ankle to the board. That allowed him to paddle away from the ferocious fish.

“The shark got tangled in his leash,” said Nancy Hussey, a director of the Southern South Carolina District of the Eastern Surfing Association, who watched the scene unfold. “He had the presence of mind to remove his leash, and I think that’s what saved him.”

Two other surfers helped Royston to shore as five lifeguards also came to his aid. He was shaken, but not hurt.

After Royston’s brush with the shark, his surfboard “tombstoned,” lingo referring to when a board turns perpendicular to the ocean surface and pops skyward out of the water. It later floated to shore.

The rest of the 2013 S.C. Governor’s Cup of Surfing, a two-day competition at The Washout on Folly Beach’s northern end, was postponed.

Contest workers helped clear the water along that portion of the beach as they summoned the Folly Beach Public Safety Department.

The agency’s chief, Dennis Brown, said authorities couldn’t immediately confirm the size or species of the waterborne assailant.

Firefighters and police officers drove to the scene in the 1500 block of East Ashley Avenue, which is north of the 13th Street East intersection, and warned beachgoers of the danger.

But in his three years as public safety chief, Brown said Sunday’s episode was the first such run-in between a swimmer or a surfer and a shark.

“We let folks know there was an incident, and they need to be cautious,” Brown said. “We told them about the perils of swimming in the area, but at the end of the day, it’s their decision.”

It was the first attack in the competition’s history, director Hussey said. Though sharks are known to prowl nearby waters, such incidents are not common, she added.

The suspected offending species, the bull shark, is known to frequent warm, shallow water. They’re also notorious for aggression.

The remaining three divisions of the event will be made up during the John Kalagian Team Challenge scheduled for Folly Beach on Sept. 7, she said.

“No prize money, no trophies or anything on the line would have moved me to put another person in the water,” Hussey said. “This was a big incident that had a very happy ending.”