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.

READ MORE: Broward Schools Supt. Robert Runcie, Former General Counsel Barbara Myrick To Be Arraigned Wednesday

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.

READ MORE: Self Proclaimed "Witch" Shannon Ryan Charged With Second Degree Murder In Leila Cavett's Disappearance

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.

MORE NEWS: Search For Missing Florida Teen Tristan Bailey Ends After Body Found, Teen Charged With Murder

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