A plan by federal agencies to rebuild the sardine population in the Pacific was not properly implemented and failed to prevent overfishing, a judge in California ruled this week.

Monday's decision by U.S. Magistrate Judge Virginia DeMarchi was a victory for environmentalists who said officials did not ensure sardine stocks would bounce back within a legally required timeframe.

The nonprofit Oceana sued the National Marine Fisheries Service in 2021, claiming that Pacific sardines collapsed by more than 98% between 2006 and 2020.

FEDS PLAN TO REINTRODUCE GRIZZLY BEARS TO WASHINGTON STATE'S NORTHERN CASCADES

The small oily fish enjoyed by humans are also essential food for whales, dolphins, sea lions, pelicans and salmon. The loss of sardines can create problems throughout ocean ecosystems, environmentalists said.

Sardines

LUBEC,MAINE - SEPTEMBER 1942: A bucket full of sardines is hauled off the boat in Lubec, Maine. (Photo by Ivan Dmitri/Michael Ochs Archives/Getty Images)

The Fisheries Service must develop a plan that supports rebuilding and set "hard, science-based caps on how many fish could be caught each year," the judge wrote in her order. The agency said it doesn't comment on litigation.

"We’re grateful that the court followed the science and recognized the need for a real plan with enforceable catch limits that will rebuild Pacific sardines for a healthy, abundant, and resilient ocean," Dr. Geoff Shester, a senior scientist for Oceana, said in a statement.

DeMarchi declined to grant some of Oceana's motions, including one asking that she order a new environmental impact statement.

CLICK HERE TO GET THE FOX NEWS APP

The judge ordered the parties to discuss and submit proposals for a remedy by May 6.