SOUTHAMPTON, N.Y. (CBSNewYork) — A barbecue turned dangerous after revelers were left stranded on a Long Island sandbar on Saturday. Thirty seven party goers needed the Coast Guard to rescue them.

An all-afternoon Hamptons party turned into a rescue involving ambulances.  While there were no injuries, police said it could have been deadly.

READ MORE: Asbury Park Businesses Hopeful For A Successful Summer With Fewer COVID Restrictions Than 2020

“It most definitely would have been a tragedy,” Southampton Town Police Sgt. Lisa Costa told CBS 2’s John Slattery on Monday.

WCBS 880 Long Island Bureau Chief Mike Xirinachs On The Story

It was a weekend keg party and barbecue on a sandbar that party goers got to by boat. However, by 8 p.m., with the tide rising, the party goers — in their 20s — realized the tide was coming up and the boats were gone.

The sandbar is located in the middle of Shinnecock Bay of the Hamlet of Hampton Bays.  Out of 40 people on the sandbar, three tried to swim for it.

READ MORE: Better Business Bureau Offers Warning As Dueling Van Gogh Experiences Create Some Confusion For New Yorkers

It was an 8-year-old girl with her father on a jetty that called attention to the emergency.  She could hear someone calling for help, police said.

“She was fantastic.  She was persistent.  She yelled for help,” Sgt. Costa said.

One man was helped onto the jetty. Fortunately, a Coast Guard vessel was in the area and picked up the two others, one of whom had drifted out of the inlet, some 600 feet into the Atlantic in the dark.

“I think they were very foolish. Anyone can see the current is very bad,” local resident Ed Schleicher said.

Three men were charged with swimming in a prohibited area. The others had to be rescued from the sandbar by boats, with a rescue effort involving ambulances, fire trucks police and a helicopter.

MORE NEWS: New Rochelle Marks One Year Since First Case Of COVID-19 Was Confirmed

Police said parties on that sandbar are not uncommon, but said people must act responsibly and arrange for boat rides off of the sandbar.