(CNN) -- A family stuck in a rip current narrowly avoided a tragedy when a crowd of strangers linked together to bring them back to land.
Nine beachgoers, including two children and an elderly woman, were trapped in the current at Panama City Beach in Florida on Saturday. Bystanders on the shore saw them yelling and waving their arms, and they jumped into action.
"I saw a group of people, a few at first, and then more and more, start forming a human chain," witness Rosalind Beckton told CNN.
The chain grew to around 70 to 80 strangers, all holding hands and stretching to reach the trapped group. All of the swimmers made it out.
How they got stuck
Roberta Ursrey was at Panama City Beach in Florida with her family on Saturday when she realized she couldn't see her sons from the shore.
She spotted the boys, who are 8 and 11, screaming and crying far out in the water, she told CNN affiliate WJHG.
Ursrey and her family ran out to rescue them, but they were overpowered by the current.
The family and several others who had tried to help Ursrey's sons themselves, nine people in total, were stuck. The group started waving their arms in the air and yelling.
"At first I thought there was a shark in the water, so I started yelling at my son to get out of the water and swim back to shore," Beckton, the witness CNN spoke to, said.
But soon, she noticed the waves taking the group further and further out to sea. A crowd gathered on the beach, unsure of how to help.
"Those waves were so heavy and big and strong," Beckton said.
Forming the chain
Police and paramedics arrived. One police officer jumped into the water and started swimming toward the group, but he soon came back. Beckton said it didn't seem like he could make it out.
"We stood there on the beach just watching, and the police, they said they were waiting for a boat to come so they could send it out," she said.
That was when the people watching from the shore decided to take matters into their own hands.
Jessica Simmons was one of the bystanders who helped create the chain. The impromptu rescuers used boogie boards and surfboards to help the family get back to shore, she recounted on Facebook.
"At the very end, we all started clapping and cheering because they were so happy over the fact that we accomplished it," Simmons told WJHG.
They pulled the boys back to the sand first, followed by Ursrey and her mother.
"As a mama, I'm supposed to be able to protect them and do everything, and I couldn't do it that day," Ursrey told WJHG. "I had to have help, which I was eternally grateful for that."
Escaping a rip current
The United States Lifesaving Association classifies rip currents as the leading surf hazard for all beachgoers.
Rip currents at beaches in the US kill over 100 people each year, the association estimates. Over 80% of rescues by beach lifeguards result from swimmers who are trapped in the current.
USLA says the trick to getting out is not to fight the current. Instead, swim in direction parallel to the shoreline to get out of the current, and then swim toward the shore.
If you can't swim, float or calmly tread water. And if none of that works, doing what Ursrey's two sons did is the right move: face the shore, wave your arms and yell to get someone's attention.
™ & © 2017 Cable News Network, Inc., a Time Warner Company. All rights reserved.