(CNN) -- It's finally legal to swim off the shore of Orange Beach, Alabama, after a crowd of sharks dispersed into deeper waters Tuesday, officials say.
The trouble on Orange Beach began Friday when a helicopter pilot took a picture of five sharks circling a boat near Perdido Pass.
The pilot relayed the picture to the city administrator, who told lifeguards to get swimmers out of the water.
On Saturday afternoon, double red flags -- warnings to would-be swimmers to stay out of the Gulf of Mexico -- were raised over the half-mile stretch of beach where the number of sharks continued to grow.
"There have been a significant amount of shark sightings prompting us to close the water in these areas. It is unlawful to enter the water when double red flags are flying," read a Saturday post on the Orange Beach Fire Department's Facebook page.
From that point, the situation only got worse.
Orange Beach safety director Melvin Shepard, who says swarms like this are extremely rare, told CNN he saw a photo of 18 sharks in the same stretch of water Sunday.
"I've lived on the coast here my whole life, and I've never seen a group of sharks as large as this one," said Shepard.
So what's drawing the sharks? Shepard has a hunch.
Coastal Alabama is known for its fresh seafood, and fishing boats are a common sight on the horizon. It's customary for fishermen returning to port to clean their catch and dump the waste material -- heads, tails, guts, bones -- into the water, leaving it to the mercy of the tides.
"When the water gets pulled out into the Gulf, the carcasses go with it. ... If (sharks) see a free meal, they're going to come get it," Shepard said.
Drawn ever closer to the source of their free lunches, the sharks could have entered waters close to shore, setting off the dangerous state of affairs in Orange Beach.
The sharks began to move away from the beach Monday. According to the fire department's Facebook page, aerial reports from that evening showed substantial dissipation in the sharks' ranks.
It was not until early Tuesday afternoon that Orange Beach was given the all-clear. The ban on entering the water was lifted after officials aerially observed only a few sharks off the jetties at Perdido Pass.
CNN's Suzanne Presto contributed to this report.