Three people from Cuba have been rescued after being stranded on a deserted island in the Bahamas for over a month.

The rescue took place on Tuesday after the Coast Guard spotted the Cuban nationals during a routine helicopter patrol of the area, ABC 7 Chicago reports.

The two men and one woman were able to survive 33 days on the uninhabited island in Anguilla Cay by eating coconuts, conch shells, and rats.

The group was initially able to grab the attention of the Coast Guard patrol on Monday by waving a flag, NBC News reports.

“We were alerted to them by the flags that they actually had in addition to a large cross that they put out there for themselves,” Mike Allert, an aircraft commander, told WPLG.

However, due to inclement weather, the rescue had to be delayed until Tuesday. The official U.S. Coast Guard Southeast Twitter account shared a video of the helicopter crew dropping water, food, and a radio to the castaways to hold them over until the rescue could happen.

“This was a very complex operation involving asset and crews from different units,” said Sean Connett, a command duty officer.

“Thanks to good communication and coordination between command centers and pilots, we were able to safely get everyone to a medical facility before the situation could worsen.”

During the extraction, the two men and woman were hoisted up to the aircraft. The rescue took around 30 minutes. The survivors were then transported to the Lower Keys Medical Center in Key West, Florida.

No serious injuries were reported by the medical team, but Allert said the group appeared to be fatigued and dehydrated due to the lack of fresh water on the island.

The three survivors told the Coast Guard they were able to swim to the deserted island after their boat capsized in rough waters.

Coast Guard helicopter
Aiming a laser pointer at this Coast Guard helicopter could land you in prison or on the hook for a massive fine. Reuters/Matt Mills McKnight