A federal judge ruled in favor of the Standing Rock Sioux Tribe on Wednesday, handing the tribe its first legal victory in its year-long battle against the Dakota Access pipeline.

James Boasberg, who sits on D.C. district court, said that the U.S. Army Corps of Engineers failed to perform an adequate study of the pipeline’s environmental consequences when it first approved its construction. In a 91-page decision, the judge cited the Corps’ study of “the impacts of an oil spill on fishing rights, hunting rights, or environmental justice” as particularly deficient, and he ordered it to prepare a new report on its risks.

The court did not, however, order the pipeline to be shut off until a new environmental study is completed—a common remedy when a federal permit is found lacking. Instead, Boasberg asked attorneys to appear before him again and make a new set of arguments about whether the pipeline should operate.

The tribe faces a mixed result: The ruling may establish some important precedents, particularly around environmental justice and treaty rights. But there’s no indication that the requirement to perform a new study will alter the outcome of the case—or even get the pipeline switched off in the interim.

“This is a a very significant victory and vindication of the tribe’s opinion,” said Jan Hasselman, the lead attorney for the case and an employee of Earthjustice, an environmental-advocacy group that represented the Standing Rock Sioux.

“The court slices things pretty thin, but there were three major areas that he found deficient, and they’re not insignificant. They’re central to the problems that we’ve been highlighting the whole time,” Hasselman told me.

Energy Transfer Partners, which owns and operates the pipeline, did not respond to a request for comment before publication. A representative for the U.S. Army Corps of Engineers could not be reached.

The Dakota Access pipeline runs 1,100 miles across much of the Great Plains, connecting the Bakken oil formation in North Dakota to a refinery and second pipeline in Illinois. Oil began flowing through the pipeline earlier this month.

The pipeline became a rallying point for both climate activists and indigenous civil-rights advocates last year, as thousands of people—many of them Native Americans—gathered on the Standing Rock reservation to protest and physically obstruct the pipeline’s construction. By late October, Standing Rock had become the largest and most high-profile Native protest in the United States in four decades.

Boasberg’s ruling centered on two ways that the Corps’s environmental study was inadequate. First, he said, the Standing Rock Sioux are assured certain hunting and fishing rights in their most recent treaty with the U.S. government. Many of the tribe’s members rely on fish or hunted game as a steady food source.

Before approving the pipeline, the Corps did not study whether an oil spill at the pipeline would kill most of the river’s fish. It also did not report on whether the chemicals used to clean up a spill could poison local game, rendering them unfit for human consumption

“Even though a spill is not certain to occur at Lake Oahe, the Corps still had to consider the impacts of such an event on the environment,” the judge said.

This emphasis on consideration points to the broader nature of the legal fight: This case is not about how the pipeline may harm Standing Rock, but whether the Corps adequately studied and reported on those harms before approving it in the first place. Most environmental-law cases in the United States are fought on this kind of procedural territory—it’s a a product of the National Environmental Policy Act of 1970, which mandates the government study the environmental effects of any decision it makes but does not require it to make especially green decisions.

Boasberg’s second complaint with the Corps was on similar methodological grounds. According to federal regulation, every major project constructed near a poor community, community of color, or Native American reservation must be studied on environmental-justice grounds. The Corps shrugged off many of these rules, arguing that no affected group lived within a half-mile of the pipeline route.

The Corps was technically correct. The Dakota Access pipeline runs 0.55 miles north of the Standing Rock Sioux reservation.

“Federal agencies are given a lot of leeway until they do something that just, on the face of it, seems ridiculous,” says Sarah Krakoff, a law professor at the University of Colorado. “I think that that’s what happened here.”

“In the vernacular, it’s a big deal,” she told me. “It’s an important step for a court to recognize that both environmental-justice claims and the failure to adequately analyze Indian treaty rights can be the basis for the reversal of an agency’s environmental analysis.”

With the project so far along, she said it was unclear if any procedural problem could convince Boasberg to temporarily shut down the project.

The tribe was not successful on every claim. The judge ruled that the Corps did not violate administrative law when it quickly approved the pipeline earlier this year. He has also previously ruled that the Dakota Access pipeline does not infringe on Standing Rock’s cultural heritage, nor does it damage the religious practice of another group of Sioux, the Cheyenne River Tribe.

The complicated legal history of the Dakota Access pipeline has stemmed from one important conflict: The pipeline mostly runs across private land, allowing Energy Transfer Partners to quickly secure permission and construct most of it last year. But it also must cross the Missouri River, a federal waterway controlled by the U.S. Army Corps of Engineers.

Therefore the dispute at Standing Rock has played out over the last year as the vast majority of the pipeline stood completed and ready for operation. In late July 2016, the Corps first granted an easement allowing the pipeline’s construction. But less than two months later, in early September, the Obama administration stepped in and asked Energy Transfer Partners to voluntarily stop work on the project. It also announced it was reviewing the Corps’s easement.

President Barack Obama revoked the permit entirely in early December 2016 at the end of that review. His administration also ordered Energy Transfer Partners and the U.S. Army Corps to study whether the pipeline could be re-routed.

That study did not last long. On his fifth day in office, President Donald Trump reversed Obama’s order and told the Corps to approve the pipeline as quickly as possible.

The president celebrated the pipeline during a speech last week in Cincinnati. “The Dakota Access pipeline is now officially open for business—a $3.8-billion investment in American infrastructure that was stalled,” he said. “Nobody thought any politician would have the guts to approve that final leg. And I just closed my eyes and said: Do it.”

“It’s up, it’s running, it’s beautiful, it’s great. Everybody is happy, the sun is shining, the water’s still clean. When I approved it, I thought I’d take a lot of heat. But I took none, actually none. But I take so much heat for nonsense that it probably overrode the other,” Trump added.

Hasselman referenced the speech as he spoke to me Wednesday. “That’s such a perfect metaphor for this whole process,” he said. “The government closed its eyes to the impacts of this pipeline on the people of Standing Rock—and their history at the hands of the same government.”

David Archambault III, the chairman of the Standing Rock Sioux, told me last week that while he is not ultimately optimistic about the legal battle, he feels duty-bound to pursue it.

“When we first entered into this, we understood the history, we knew the facts, we knew the laws,” he said. “We still have to bring it all up. Because just because [the situation] is legally right, it’s morally and ethically wrong. What happened at Standing Rock is a movement, and you don’t see the benefits of a movement until way later.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.

Robinson Meyer is a staff writer at The Atlantic, where he covers climate change and technology.