U.S. District Court Judge Brian Morris in Great Falls ruled late Thursday that the U.S. government didn't complete a full analysis of the environmental impact of the $8 billion pipeline and that it "fell short of a hard look" at the effect the project could have on climate change and Native American land resources.
The judge's ruling follows a lawsuit filed in 2017 by several environmental groups against the U.S. government, soon after President Donald Trump announced a presidential permit for the project.
TransCanada didn't immediately respond to a request for comment. Trump told reporters at the White House that the ruling was "a political decision made by a judge."
"I think it's a disgrace," Trump said.
The 1,184-mile pipeline would transport up to 830,000 barrels of crude a day from Alberta, Canada and Montana to facilities in Nebraska.
Former President Barack Obama rejected the pipeline in 2015, noting environmental concerns related to emissions that cause climate change.