Humpback whales that were entangled in marine gear off the coasts of Maine and Massachusetts were freed by whale rescue teams, officials report.

People aboard a whale watch boat spotted a distressed humpback whale on Saturday 15 nautical miles southeast of Mount Desert Island.

The gear was cutting deep into the whale's head, according to the Provincetown Center for Coastal Studies in Massachusetts.

When the whale moved close enough to the surface Sunday, a rescue team aboard a 17-foot inflatable boat cut the line with a knife mounted on a pole, the center said. The entangling gear dropped free and the whale disappeared into the fog.

Also Sunday, a second rescue team freed another humpback whale 150 miles away off the Massachusetts coast.

Humpback whales are listed as endangered species in the United States. About 12,000 humpbacks are estimated to live in the North Atlantic, with 900 feeding seasonally off the Northeast coast of the U.S., according to the center.

Entanglements are a leading cause of whale deaths. Boat strikes are also a threat to humpback whales, which are an endangered species.