It wasn’t until Brian Daniels heard yelling from eight floors below him that he realized something was wrong.

He and his wife had been drinking coffee on their hotel balcony Sunday in Panama City Beach, Fla., savoring a few minutes of quiet before their sons would wake up, when they heard the alert. Sheriff’s officers ordered all swimmers to get out of the water. Rip currents from Tropical Storm Barry had made the surf perilous, and no one was allowed in past their ankles.

Plenty of people ignored the double red flags that warned them not to swim, Daniels said. Then the couple noticed something in the distance: A man and a woman had gotten stranded in a rip current about 30 yards into the Gulf of Mexico. A sheriff’s officer dove into the water to try to save them, and a few other rescuers followed shortly after.

Daniels, 44, was filming the rescue when he saw people spontaneously grab one another’s hands. One by one, about three dozen people created a human chain that stretched from the sand into the waves, where they were desperately trying to reach the swimmers.

“A lot of times when you have situations like that, people just stand there and look like deer in headlights,” Daniels said in an interview Tuesday. “But these people were really brave, and they were very driven to help other people.”

The beachgoers created the chain twice for about 10 minutes, Daniels said — first to try to reach the female swimmer and another time to aid one of the rescuers who seemed to be in distress. At one point, Daniels said, the waves hit the human chain so forcefully that their rescue efforts became too perilous. Rescuers told them to get out of the water for their own safety.

The rescuers reached both swimmers around 11:30 a.m. and pulled them safely back to shore. Although Daniels said the Bay County Sheriff’s Office was probably more responsible for the rescues than the vacationers who formed the chain, he said he was touched that the beachgoers had put their own safety on the line for strangers.

“They didn’t even know them, and they were out there risking their lives,” Daniels said.

Those who did not join the Good Samaritan chain helped by making “nonstop calls for rescue” Sunday, Panama City Beach Fire Rescue wrote on Facebook.

The fire rescue post also said, “The decision to ignore the warnings has impacts far beyond the swimmer that becomes distressed,” as the lives of rescuers are also at risk.

People who get caught in a rip current should stay calm, call and wave for help, and swim parallel to the beach while following breaking waves back to the shore, according to the National Oceanic and Atmospheric Administration.

Read more: