Carcass of a dead sperm whale next to the International Fishing Pier in Deerfield Beach. A sperm whale carcass similar to this one was found off the coast of Key Largo Thursday.

POMPANO BEACH (CBSMiami) – The carcass of a 40-foot female sperm whale was found early Monday near the International Fishing Pier in Deerfield Beach.

A Broward Sheriff’s Office statement said beachgoers spotted the whale Sunday morning off Pompano Beach about 40 feet from shore. Tides kept washing the whale close to shore as rip currents pulled it back out.

Blair Mase from the National Oceanic and Atmospheric Administration told CBS4 News that NOAA has taken some specimens from the whale to study and try to determine how it died. NOAA wanted to pull the carcass on to the shore in order to perform a necropsy but the city didn’t want them to. Instead, SeaTwo will pull the carcass out to sea.

Meanwhile, authorities are planning an investigation into the whale’s death after a swimmer was seen straddling the animal.

NBCNews.com reports that NOAA plans to look into a report from resident of Pompano Beach, Margie Casey, who said she saw the whale alive earlier in the day and saw one of two swimmers get on top of the whale.

It’s illegal to harass a marine mammal and if someone did get on top of the whale, it could have caused further stress and contributed to its death, according to Mase.

A marine biologist monitoring the whale’s progress noted that it had scarring, which may have come from it being hit by a boat.

Sperm whales are the largest of the toothed whales and an endangered species