NEW ORLEANS (AP) — A federal judge has ruled that the U.S. Army Corps of Engineers must consult with federal fisheries experts on the effects of opening a spillway that protects New Orleans from Mississippi River flooding, but threatens coastal Mississippi marine life and tourism.

The Bonnet Carre spillway control structure is upriver from New Orleans. It was used infrequently after it was completed in the 1930s. But after being opened once in 2018, it was opened twice in 2019 — the first time it was opened in consecutive years and the first time it was used twice in one year.

Opening the spillway diverts Mississippi River water along a 6-mile (9.7-kilometer) course of guide levees to Lake Pontchartrain and Lake Borgne, after which it flows to the Mississippi Sound in the Gulf of Mexico. The influx of river water carries pollutants and nutrients into the sound and reduces salinity. The result can be damage to oyster, fish and crab habitats, and algae blooms that also affect marine life and beaches.

Coastal Mississippi governments and business interests sued the Corps over the openings in 2019, saying the Corps was legally required to consult with the National Marine Fisheries Service before opening the spillway. On Wednesday, U.S. District Judge Louis Guirola Jr. agreed. He said there was evidence that the Corps “created an increased risk of actual, threatened, or imminent environmental harm that directly affected the Plaintiffs when it opened the Spillway without consulting with the Fisheries Service.”

“Consultation in the future may well require the Corps to consider alternatives that would lessen this environmental harm and additional damages to Plaintiffs,” Guirola added.

Guirola said a consultation between the Corps and NMFS on the effects of opening the spillway must be completed by Sept. 30. Whether that would preclude the Corps from opening the spillway should a high Mississippi River threaten New Orleans before the consultation is completed was not immediately clear.

A Corps spokesman declined comment, referring queries to the U.S. Department of Justice. A department attorney didn’t immediately respond to an emailed request for information.

Biloxi, Mississippi’s mayor, Andrew “FoFo” Gilich, hailed the ruling in an emailed news release. “The Coast finally has a foot in the door through the National Marine Fisheries Service for our voices and scientific facts to be heard to prevent the death of the Mississippi Sound,” Gilich said.