SANDY HOOK, N.J. (AP) — Crews have successfully disentangled a humpback whale that got caught in material in waters off New Jersey.

The juvenile whale — estimated to be more than 30-feet-long — was freed Wednesday. It had been spotted in the Raritan and Sandy Hook bays in recent days.

Officials say the whale had a piece of gill net — a type of netting used in commercial fishing — wrapped around its mouth, forming a closed loop around its blowhole.

Numerous responders — including federal, state and local authorities and a disentanglement team from the nonprofit Center for Coastal Studies — worked together Wednesday to free the whale. They used a custom-designed hook-shaped knife, attached to a roughly 15-foot-long pole, to slice the piece of netting.

The whale was not harmed.