Dozens of people risked their lives Sunday to save a swimmer caught in a rip current of Panama City Beach, Florida.

The group formed a human chain stretching from the shore to the swimmers.

"There must have been 50 to 100 people holding hands, lined up from the beach-side out to the waves so they could help the rescuers and help the people come to shore," said witness Shelly Callaway.

All of the swimmers were saved, but four more people who were part of the chain ended up having to be rescued as well.

Double red flags were flying at the time, which means it's illegal to enter the water.

Although the act might be heroic, Bay County Sheriff's officials say it's still illegal and dangerous to enter the water, even if you are saving someone.

"I know that seeing somebody in trouble while you're on the sand is a heart-wrenching thing to go through, but whenever a deputy gets on scene, if there's already people going out there to help, that's going to add more victims," says Sgt. Mike Morris.

Read more at WJHG's website