Yesterday, an onlooker captured shocking footage of a massive fin whale stranded in a tidal area near Naragansett, Rhode Island. In an Instagram post shared by Spear-It Charters, the enormous whale is seen struggling for air while a person films from behind a line of caution tape on a nearby pier. According to a recent update from the Rhode Island Department of Environmental Management (RIDEM), wildlife officials euthanized the whale around 9 p.m. last night.

Rhode Island officials said the whale weighed approximately 25,000 pounds and stretched more than 40 feet in length. “Whales are magnificent creatures and it’s very sad when these circumstances occur,” said Scott Olszewski, a marine biologist and Deputy Chief of the RIDEM Division of Marine Fisheries. “Given this fin whale’s extremely compromised state, intervening medically was the most humane way of easing its suffering.” 

Officials euthanized the whale around 9:20 p.m. last night, according to an RIDEM Instagram post. While they described the whale’s death as a sad turn of events, they say it’ll offer scientists said “a rare opportunity to gather valuable information, which, hopefully, can be used to protect these animals from further endangerment.”

According to the National Oceanic and Atmospheric Administration (NOAA), fin whales are among the largest mammals on earth, second only to the blue whale. The species is named for a prominent fin that sits on the back of the whale’s body near the tale. For management purposes, NOAA divides the world’s fin whale populations into four separate stocks: the California/Oregon/Washington stock, the Hawaii stock, the Alaska stock, and the Atlantic Northwest Stock.

Read Next: Researchers Investigate Endangered Whale That Washed Ashore in Mississippi

Fin whales have been protected under the Endangered Species Act since 1970. Major threats facing the species today include vessel strikes, entanglements in fishing gear, climate change, and ocean noise. “Increasing evidence suggests that exposure to intense underwater sound in some settings may cause some whales to strand and ultimately die,” NOAA says.