Updated on June 12 at 11:50 a.m. ET

After months of protests, more than 750 arrests, and high-profile interventions by both the Obama and Trump administrations, the first part of the battle over the Dakota Access pipeline has ended.

Oil is now flowing through the pipeline—and, crucially, beneath Lake Oahe in North Dakota, which is sacred to local Lakota and Dakota people and their only source of water.

But the battle over the pipeline is not over yet. A legal challenge to the pipeline—and to President Donald Trump’s rapid approval of it in January—is awaiting summary judgment in federal court in the District of Columbia.

The pipeline now runs more than 1,800 miles, linking oil fields in North Dakota to refineries, ports, and further pipelines in southern Illinois. Eventually it will transport more than 520,000 barrels of oil per day. Energy Transfer Partners, which owns the project, hailed it as “more direct, cost-effective, safer and more environmentally responsible … than other modes of [crude-oil] transportation, including rail or truck.”

“There’s 17 million people downstream. Just because oil is flowing today doesn’t mean it won’t leak in the future,” said David Archambault II, the chairman of the Standing Rock Sioux Tribe. Standing Rock was among the first groups to legally challenge the pipeline, and the thousands of protesters who gathered to oppose it camped on their land.

“There’s an uneasy feeling that any moment, this pipeline could pose a threat to our way of life. It’s something you have to carry and be wary of all the time, and be ready for,” Archambault told me.

Energy Transfer Partners says their pipeline exceeds minimum federal safety requirements in many instances. Dakota Access “is monitored 24/7 by a control center for pressure, temperature, density and flow changes; has strategically placed valves with emergency shutdown systems; and is inspected in multiple ways throughout the year,” said a spokeswoman for the company.

President Trump cited the pipeline’s completion as a political victory on Wednesday.

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

“It’s up, it’s running, it’s beautiful, it’s great. Everybody is happy, the sun is shining, the water’s still clean,” the president added. “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.”

On the fifth day of his presidency, Trump cancelled the Obama administration’s order that Energy Transfer Partners prepare an environmental-impact statement for the project. The Obama order had also asked Energy Transfer Partners to study alternate routes for the pipeline.

As recently as 2015, Trump owned between $500,000 and $1 million in stock in Energy Transfer Partners, according to the Dallas Morning News. This amount had decreased to less than $50,000 by the spring of 2016.

Hope Hicks, a spokeswoman for Trump, said in late November that he divested himself of Energy Transfer Partners and all other stocks in the summer of 2016. But the White House has repeatedly declined to offer proof of this.

“‘The sun is still shining, and the water is still clean.’ For him to say that just goes to show how out of touch and how out of tune he is with the people in his own country,” said Archambault on Thursday. “He’s putting his own grandchildren’s future at risk. But he doesn’t see it like that. He doesn’t see the cost in the future, he just sees the dollars gained today.”

The Standing Rock fight was a rare, high-profile moment for the Native American civil rights movement in the United States, in part because it united climate activists and indigenous advocates behind a common goal. Climate groups like 350.org opposed the pipeline because they disapprove of almost all new fossil-fuel infrastructure; indigenous activists saw the pipeline as another profit-seeking incursion onto their land.

Eventually, the fight seemed to transcend the climate cause, as tens of thousands of Americans showed digital solidarity with the Standing Rock protests. The protesters also reframed the politics of climate on the left: Lakota and Dakota protesters from Standing Rock led a major climate rally in Washington, D.C., this April.

The legal challenge to the pipeline turns on far more technical concerns. Since last summer, the tribe has alleged that Energy Transfer Partners did not properly study how the pipeline could damage the Missouri River or its local cultural sites. They also claim that President Trump violated the Administrative Procedure Act when he overturned a previous Obama order and rapidly approved the pipeline in January.

Energy Transfer Partners, which is joined by the U.S. Army Corps of Engineers, says it followed the law. So far, the judge in the case has seemed to sympathize with the Standing Rock tribe, but he has repeatedly ruled that Energy Transfer Partners and the U.S. government followed the right procedure and complied with the law. The Standing Rock Tribe and Energy Transfer Partners both filed briefs months ago, so a final summary judgment in the case could arrive at any time.

Archambault says he is not optimistic about the case’s outcome, but that the tribe will appeal any ruling. “How can one be optimistic when we know the judicial system in the United States is founded on the doctrine of discovery?” he asked.

The doctrine of discovery, affirmed by Chief Justice John Marshall in Johnson v. Mc’Intosh in 1823, says that indigenous people lost their claim to North American lands when they were occupied by the subjects of a European Christian monarch. Though widely criticized, the legal concept has been cited by the U.S. Supreme Court as recently as 2005.

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