Updated

A juvenile humpback whale freed itself Monday from a tangle of fishing line that had stranded it about a quarter-mile off the Rhode Island coast for several days.

Rescuers in boats worked for hours to free the underweight and wounded whale, which became increasingly aggressive.

By swimming back and forth, the whale managed to break loose after an hours-long struggle, said April Valliere, a marine fisheries biologist for the Department of Environmental Management.

"We saw it just kind of take a real long surge, and each successive one was longer," she said. "All of the sudden, it got a burst of steam and off it went."

• Click here to visit FOXNews.com's Natural Science Center.

DEM police officers followed the whale in a boat and reported that it was free from fishing lines, although it's possible a few smaller lines may remain, Valliere said.

Witnesses first reported seeing the mammal on Friday about a quarter-mile off Weekapaug Beach and assumed it was feeding on bait fish.

On Sunday, a volunteer for the Mystic Aquarium's stranding network happened to be boating in the area and noticed that the whale was tangled in what appeared to be a fishing net and perhaps rope, aquarium officials said.

The gear has not been recovered or positively identified.

Wildlife experts said the whale appeared thin, probably because it could not feed while it was tangled, and had several lacerations near its dorsal fin.

"It's not in good health," Valliere said. "It's probably been tugging on this for two days trying to get out of it."

Humpback whales are an endangered species that live off the coast of New England and elsewhere in the U.S.