The Army's review of a proposal to finish the Dakota Access pipeline could be the beginning of the end for opponents who have been fighting the project for nearly a year.
The protest was still going on Wednesday when authorities said they arrested 76 people after they refused to leave a camp set up on private land.
But the American Indian tribe at the center of the debate, the Standing Rock Sioux, vows to keep battling the pipeline in court out of fear that an oil leak could contaminate its drinking water.
• The protests at Standing Rock: Oil, water, race and treaty rights
Here's a look at the legal steps that remain before the last section of pipe can be laid and the final options to stop it.
What are the latest developments?
On Tuesday, the acting secretary of the Army ordered a review of an earlier decision to block the last section of pipeline from being laid under a Missouri River reservoir. The move came just days after President Donald Trump issued a memo calling for reconsideration of the December decision by the Army Corps of Engineers.
Based on a discussion with the Army secretary, Robert Speer, Republican Sen. John Hoeven said Wednesday that there is no doubt in his mind that permission to finish the project will be granted.
A government assessment last summer determined that the final segment would not have a significant effect on the environment. However, then-Assistant Army Secretary for Civil Works Jo-Ellen Darcy on Dec. 4 declined to give permission for construction to begin, saying a broader environmental study was needed.
The pipeline builder, Energy Transfer Partners, called Darcy's decision politically motivated and accused then-President Barack Obama's administration of delaying the matter until he left office. Two days before he left the White House, the Corps launched an environmental study that could take up to two years.
What is the tribe likely to do?
Army attorneys have said the environmental study could be withdrawn. Should that happen, the tribe will probably challenge the move on two fronts — that the study is necessary to preserve tribal treaty rights and that it's part of the legal process for obtaining final permission to finish the pipeline, as the Army has maintained, according to tribal attorney Jan Hasselman.
The Army cannot arbitrarily change its mind because of the change in White House administrations, said Monte Mills, co-director of the University of Montana's Indian law clinic.
Given that the Army said in December that an environmental study was necessary, Mills said, the Army would have to explain how its new decision was consistent with the legal standards it used in December and how there's a reasonable basis for change.
Otherwise the tribe could argue the reversal was "arbitrary and capricious," in violation of federal law, he said.
But Connie Rogers, a Denver attorney who specializes in federal permits, natural resources and Indian law, said the Army does have the discretion to change its mind. Since the original environmental assessment found nothing that would require an additional study, the Army was not required by law to order the fuller review and therefore can reverse course, she said.
What about treaty rights?
The tribe says under the Fort Laramie Treaties of 1851 and 1868, the federal government is obliged to consider a tribe's welfare when making decisions affecting the tribe.
That would be one likely argument against the Corps withdrawing the environmental study that the tribe has repeatedly demanded, Hasselman said.
Tribes have effectively used old treaty rights in other high-profile court cases. For example, a landmark ruling in Washington state in 1974 affirmed tribal fishing rights in treaties stemming from the 1850s.
"Without question, treaties, especially during modern times, have proven to be very successful legal vehicles for tribes in defense of existential threats," said Gabriel Galanda, a Seattle lawyer who represents tribes throughout the West.
When the Corps published a notice last month in the Federal Register, the agency explained that it was looking for a better understanding of how the pipeline would affect treaty rights. If the government isn't going to look at those rights now, Mills said, it will have to explain why.
Looking ahead for legal options
Should the Corps give permission to build the last piece of the pipeline, the tribe would immediately ask U.S. District Judge James Boasberg to temporarily ban construction while the legal issues are decided, Hasselman said.
The builder would probably fight that, and Rogers said the tribe would have to clear "a high bar" to convince the judge.
But other options to challenge the project remain. In a lawsuit it filed last year, the tribe alleges that the government broke environmental law by approving the pipeline's crossing of numerous waterways, and "the remedy is to turn off the pipeline," Hasselman said.
That lawsuit is still pending and could be the basis for more delays and courtroom arguments.