A federal court has ruled that an environmental review exemption by the Trump administration for a pipeline to extract water from the Mojave Desert is illegal.

The 43-mile pipeline planned by Cadiz Inc. would cut through Mojave Trails National Monument and other public lands in Southern California to suck groundwater out of the desert aquifer and sell to cities. It would pump an estimated 16 billion gallons a year from the fragile desert ecosystem.

Judge George Wu of the U.S. District Court for the Central District of California ruled Thursday that the federal Bureau of Land Management failed to provide sufficient evidence for its 2017 decision to reverse its own 2015 decision requiring an environmental review for the pipeline. A full review could take at least a year and could open up Cadiz to even more litigation.

Cadiz, citing an obscure 1873 law, had argued it had a right to build the pipeline within a railroad right-of-way without environmental review as long as the water had a rail-related use. Cadiz claimed that some water would be used by another party to operate a steam-powered train.

The Obama administration rejected the argument and ordered a full environmental review. That decision was reversed by the Trump administration following the appointment of David Bernhardt, a former lobbyist for Cadiz, as deputy interior secretary. He’s now secretary of the interior.

“We’re grateful the court decision will stop the Trump administration’s blatant attempt to do a favor for their corporate friends,” said Lisa Belenky, a senior attorney with the Center for Biological Diversity, one of the environmental groups that sued to halt the project. “This massive water-privatization scheme is not sustainable. Cadiz will devastate the entire Mojave Desert ecosystem that relies on that water for survival.”

Extracting the water to sell will destroy vegetation, including the famous Joshua trees, and threaten the survival of wildlife, including the rapidly vanishing desert tortoises, kit foxes, the Mojave fringe-toed lizards and bighorn sheep, according to the center. A study by the U.S. Geological Survey in 2017 determined that the project would be catastrophic for the desert. “Based on the independent study, it’s clear that Cadiz would quickly drain the aquifer, destroying all of the desert life it supports,” Sen. Dianne Feinstein (D-Calif.) said at the time.

Earthjustice attorney Greg Loarie hailed the court for seeing “right through the Trump administration’s attempt to shoehorn the massive Cadiz pipeline into a railroad easement through Mojave Trails National Monument.”

Cadiz said in a statement that the company considers the ruling a procedural matter that will easily be resolved, the Los Angeles Times reported.