Veterinarians euthanized the humpback whale that had been stranded in Moriches Bay on Wednesday afternoon, officials said.

A medical team examined the whale Wednesday morning and determined it suffered from “gravitational collapse of its cardiovascular system” and extensive skin damage with evidence of infection caused by the seagulls that had pecked at the creature for days. The 33-foot-long humpback whale, which weighed between 14 and 15 tons, also exhibited signs of neurological damage, according to Craig Harms, a veterinarian specializing in whales, who traveled from North Carolina to assess the mammal.

Harms said it was evident that the whale was suffering and that euthanasia was the most humane option.

About 1:20 p.m., veterinarians administered sedatives and pain killers to the whale before injecting it with a lethal dose of potassium chloride, Harms said.

Officials will soon move the body and perform a necropsy to determine what caused the stranding, according to Kim Durham, the Riverhead Foundation’s rescue program director.

The whale was first seen stranded in Moriches Bay Sunday in water about 1 to 2 feet deep, according to NOAA.

advertisement | advertise on newsday

The Riverhead Foundation attempted to move the whale Sunday by creating wave action by boat to help the animal dislodge itself, but was unsuccessful.

A group of citizens who operated a barge equipped with an excavator had wanted to dig a hole next to the whale in order to help the animal dislodge itself. Harms said a similar technique has worked in the past, but in this case there was a chance the whale would have fallen sideways into the hole and suffocated.

Gov. Andrew M. Cuomo and the state Department of Environmental Conservation Commissioner Basil Seggos had both urged NOAA to make every effort to save the whale.

“The state devoted all available resources this week to save the whale and we, along with many New Yorkers, are saddened by today’s unfortunate outcome,” Seggos said late Wednesday.

Adrienne Esposito, executive director of Citizens Campaign for the Environment, urged local lawmakers to form a “whale response task force.”

“This scenario can easily happen again and when it does, we need to be ready for it,” she said in a statement.

State Sen. Kenneth P. LaValle (R-Port Jefferson) called for a Senate hearing “to address issues that arose” during the whale rescue effort.

NOAA officials said Wednesday it would have been extremely difficult to move the whale, which was much larger than they had originally estimated and had only a “minimal” chance of surviving in the wild. Such actions are typically unsuccessful and result in injuring the animal or the animal restranding itself, according to NOAA.

advertisement | advertise on newsday

“The logistics of mounting a rescue would have been very daunting,” Harms said.

John Bullard, director of NOAA’s Greater Atlantic Regional Fisheries Office, said in a statement that NOAA was “deeply grateful for the assistance” offered by the state.

“It’s clear that this response was not limited by resource availability; rather, the tidal conditions and other oceanic or biological factors that led to this stranding overtook any ability by our responders to rescue it,” Bullard said.