Photo at Standing Rock by Hazel Hindsley

A federal judge on Monday sided with the Standing Rock Sioux Tribe and ordered that the Dakota Access pipeline must shut down by Aug. 5 until more environmental review is done.

The district court ruling is a defeat for the Trump administration and a major win for the Standing Rock Sioux Tribe and environmental groups that have fought for years against the pipeline that crosses beneath the Missouri River, just north of the Standing Rock reservation. Trump originally granted the permit in 2017.

In its Monday decision, the U.S. District Court for the District of Columbia said a crucial federal permit for Dakota Access fell too far short of National Environmental Policy Act requirements to allow the pipeline to continue operating. The court scrapped a key permit from the Army Corps of Engineers and ruled the pipeline be shut down pending a full environmental review ordered previously.

“The Corps had failed to produce an Environmental Impact Statement despite conditions that triggered such a requirement,” the court ruling stated. “Although mindful of the disruption such a shutdown will cause, the Court now concludes that the answer is yes.

“Given the seriousness of the Corps’ NEPA error, the impossibility of a simple fix, the fact that Dakota Access did assume much of its economic risk knowingly, and the potential harm each day the pipeline operates, the Court is forced to conclude that the flow of oil must cease,” the ruling continued.