On Sunday, energy companies scrapped their proposal for a 600-mile pipeline carrying natural gas from West Virginia into North Carolina and Virginia, which would cross forested lands with rivers and wetlands. The Atlantic Coast Natural Gas Pipeline has faced fierce opposition from environmental advocates ever since it was announced in 2014. The CEOs of the companies responsible for the project, Dominion Energy and Duke Energy, announced they were cancelling the pipeline. “A series of legal challenges to the project’s federal and state permits has caused significant project cost increases and timing delays,” they wrote in a press release. The companies cited “increased legal uncertainty” and the cost of fighting litigation as reasons for giving up on the project. Then, on Monday, a federal judge declared that the Dakota Access Pipeline must cease its flow of oil in 30 days, by August 5th. The decision is a follow up to a March ruling that required the Army Corps of Engineers, the government agency overseeing the project, to prepare an environmental impact statement, but left open the question of what to do with the pipeline in the interim. The Dakota Access Pipeline project became a high-profile environmental justice case in 2016, when the Standing Rock Sioux and other Native American tribes filed a lawsuit about the pipeline on religious freedom and historic preservation grounds. In particular, activists and indigenous people were concerned about a portion of the pipeline that routes under Lake Oahe, a reservoir on the Missouri River at the border of North and South Dakota. They argued that the risk of oil leaking into water supplies, along with the destruction of indigenous burial sites, had not been adequately considered. The Obama administration blocked construction of the disputed segment of the pipeline in late 2016. But early the next year, President Trump quickly revived the project, allowing oil to start flowing soon after. Later in 2017, the Standing Rock and Cheyenne River tribes brought a new case arguing that the Corps should have prepared an environmental impact statement before proceeding with the pipeline. Under the National Environmental Policy Act (NEPA), this thorough environmental review document is required for projects that could have “significant” environmental impacts. In March of this year, the court found that because the pipeline’s effects were “likely to be highly controversial” based on “concrete objections to the Corp’s analytical process and findings,” and the Army Corps needed to go back and prepare an environmental impact statement. Judge James E. Boasberg announced at the time that he would hear out both sides on what to do in the interim—it would take the Corps about 13 months to prepare the necessary report, but oil was already flowing. Now, the court has ruled that at least until the report is ready, the pipe must cease operations. “When it comes to NEPA, it is better to ask for permission than forgiveness: if you can build first and consider environmental consequences later, NEPA’s action-forcing purpose loses its bite,” wrote Boasberg in the court decision. “The Court does not reach its decision with blithe disregard for the lives it will affect,” Boasberg wrote. “It readily acknowledges that, even with the currently low demand for oil, shutting down the pipeline will cause significant disruption to DAPL, the North Dakota oil industry, and potentially other states. Yet, 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.” Robin Kundis Craig, an environmental law professor at the University of Utah, says that the decision is a consistent application of environmental law, and Dakota Access doesn’t seem to have sufficient legal grounds to appeal. “To conclude that [the pipeline] was going to have no impacts was probably clearly erroneous,” says Craig. “Shutting down the pipeline until a proper environmental impact statement is drafted is the standard NEPA response.” Oil and gas pipelines seem to be under close scrutiny these days, and the two pipeline shutdowns demonstrate the increasing legal challenges that energy companies face. In the case of the Atlantic Coast pipeline, the statement released by the company specifically cited recent court decisions that froze the use of Clean Water Act nationwide permits allowing the dredging and filling of wetlands. Because of the increased legal pressure, the energy companies would have to pay for the preparation of an individual permit under the Clean Water Act, which is more costly. “The prospect of having to go through an individual form or permit process was a significant factor in deterring the project,” adds Craig, “which perhaps suggests that some of these projects are operating on a pretty razor thin cost benefit analysis to begin with.” As for Dakota Access, it’s future will likely now be decided in 2021, when that environmental impact statement gets published and whoever’s in the Oval Office then decides whether to grant the energy company permits to proceed. There may also be reason to worry about the impacts of rollbacks to NEPA, which could make it easier to push through projects without review. For now, it seems, activists can breathe a small sigh of relief.