ANCHORAGE, Alaska (AP) — A U.S. agency did not properly consider how tugboat noise tied to planned oil and gas drilling in Alaska could affect endangered beluga whales, a judge has ruled.

U.S. District Court Judge Sharon Gleason's decision Tuesday came in a lawsuit filed by conservation groups Cook Inletkeeper and the Center for Biological Diversity.

Oil and gas company Hilcorp applied in 2018 for authorization from the National Marine Fisheries Service for activities related to an exploratory drilling program in Cook Inlet through 2024 that could disrupt beluga whales and other marine mammals with loud noise, the Anchorage Daily News reported.

The federal agency's recovery plan for the whales identified noise from tugboats as a major threat, but the National Marine Fisheries Service did not properly consider the impact of that noise when it approved Hilcorp's request, the judge said.

The estimated number of beluga whales that stay year-round in Cook Inlet, a waterway connecting Anchorage to the Gulf of Alaska, has dropped from about 1,300 in 1979 to about 279 in 2018.

The National Oceanic and Atmospheric Administration has listed diminishing food supply, habitat loss, pollution and human-caused noise among the threats to the whales but also has said it does not know why the population is not recovering.

NOAA has said pervasive noise could inhibit the ability of beluga whales to hear, communicate and find food.

Gleason ordered the sides to propose an “appropriate remedy” within two weeks.

Luke Miller, a Hilcorp spokesperson, had no immediate comment Wednesday. Julie Fair, a spokesperson for NOAA Fisheries in Alaska, said the agency was reviewing the decision.

The ruling could affect Hilcorp’s plans for oil and gas exploration in federal and state waters, but it would not affect existing production, said Bob Shavelson with Cook Inletkeeper.