GLOUCESTER (CBS) — Crews worked for over nine hours Wednesday to free a humpback whale that had become entangled in fishing lines.

The Center for Coastal Studies’ Marine Animal Entanglement Response Team, based out of Provincetown, used underwater cameras to cut the lines and free the whale around 7:30 p.m. Wednesday, with help from the Massachusetts Environmental Police.

READ MORE: 4-Year-Old Hurt In Hit-And-Run In Lynn

Marine Animal Entanglement Response crew used a hooked knife to cut entanglement from humpback whale Foggy. CCS image taken under NOAA permit #18786.

Marine Animal Entanglement Response crew used a hooked knife to cut entanglement from humpback whale Foggy. CCS image taken under NOAA permit #18786.

In a press release, the Center for Coastal Studies said this was the second time this particular whale, a 26-year-old humpback whale named Foggy, had to be rescued from entanglement–she had been caught in a similar fashion in the Bay of Fundy, Nova Scotia in September 2013.

READ MORE: Over 300,000 Baby Pacifiers Recalled Due To Choking Hazard

Workers were able to cut a number of lines to free the whale, but said they had to leave a collar of heavy rope, about 1 inch thick and embedded 3-6 inches deep in her blubber and muscle, because removing it likely would have killed her. The Center for Coastal Studies said that, despite being freed, the whale’s prognosis “is still quite poor.”

A collar of heavy line remains embedded in the whale's body. CCS image taken under NOAA permit #18786.

A collar of heavy line remains embedded in the whale’s body. CCS image taken under NOAA permit #18786.

“We dulled or broke every knife in our kit and every teammate worked their fingers to the bone for this whale,” Scott Landry, Director of the MAER program, said in a release. “Short of removing the 40 ton whale from the ocean and performing surgery, we did everything humanly possible for this individual. With the collar now broken she has a chance to naturally reject the rope but she is quite thin and in poor condition so we have to hope for the best.”

MORE NEWS: Massachusetts Nurses Union Wants Baker's Help To Address 'Overwhelmed And Burned Out' Workers

The Center for Coastal Studies thanked fishermen who reported the entangled whale, and to the Mass. Environmental Police for their assistance.