The controversial Dakota Access Pipeline has been ordered to suspend production by a US judge, amid concerns over its environmental impact.
The order is a major win for the Standing Rock Sioux Tribe, which has led the fight against the pipeline.
The ruling demands the pipeline is emptied within 30 days so another environmental review can take place.
Separately, the Supreme Court blocked another controversial oil pipeline from continuing construction.
Judges sided with environmental groups, requiring the Keystone XL Pipeline - which would stretch from the Canadian province of Alberta to Texas in the southern US - to undergo an arduous review before construction can resume.
Both projects were backed by US President Donald Trump during the 2016 presidential election after they were blocked by his predecessor, Barack Obama.
What is the Dakota Access Pipeline?
The $3.7bn (£2.8bn) 1,200 mile-(1,900km) long pipeline, completed in 2017, can transport some 570,000 barrels of crude oil a day across four states, from North Dakota to a terminal in Illinois, where it can be shipped to refineries.
Supporters of the pipeline, owned by Energy Transfer, argue it provides a more cost-effective, efficient means of transporting crude, rather than shipping barrels by train.
But the Standing Rock Sioux and their supporters argued the project - which passed just north of the tribe's reservation - would contaminate drinking water and damage sacred burial sites.
What did the judge say?
Federal judge James E Boasberg, sitting at the District Court for the District of Columbia, ruled that the construction of the pipeline had fallen short of environmental standards.
It therefore needed to undergo a more thorough environmental review than had been conducted by the US Army Corps of Engineers before it could be allowed to continue working, he said. The process is expected to take 13 months, according to the Financial Times.
"Given the seriousness of the Corps' Nepa (National Environmental Policy Act) 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," Judge Boasberg's ruling concluded.
It's been a bad week for fossil fuel pipelines in the US.
Dakota Access owners, Transfer Energy, now face the horrendously expensive prospect of shutting down their oil pipeline for over a year while the Army Corp of Engineers undertake a far more comprehensive assessment of the environmental impacts.
Oil pipelines are seen as controversial because of their potential for leaks or accidents. In the Dakota case, the court ruled that there had not been adequate consideration of the "impacts of an oil spill on fishing rights, hunting rights or environmental justice…".
The Dakota decision comes just days after the cancellation of the Atlantic Coast gas pipeline project, due to run between West Virginia, Virginia and North Carolina.
The developers said that legal delays and ongoing litigation made the project uneconomic.
The problems for both projects underline once again that battles over fossil fuel infrastructure are the new front line in the struggle between environment and economics in the US.
What has the response been?
Chairman Mike Faith, of the Standing Rock Sioux Tribe, said it was a "historic day" for all those who had fought the pipeline.
"This pipeline should have never been built here," he said. "We told them that from the beginning."
But Energy Transfer said it did not believe the ruling was "supported by the law or the facts of the case".
Spokeswoman Lisa Coleman told news agency AFP they believed "Judge Boasberg has exceeded his authority in ordering the shutdown of the Dakota Access Pipeline, which has been safely operating for more than three years".