FILE- This Nov. 6, 2015, file photo shows a sign for TransCanada’s Keystone pipeline facilities in Hardisty, Alberta, A federal judge in Montana has blocked construction of the $8 billion Keystone XL Pipeline to allow more time to study the project’s potential environmental impact. U.S. District Judge Brian Morris’ order on Thursday, Nov. 8, 2018 […]

In a setback for the Trump administration, a federal judge has blocked a permit for construction of the Keystone XL oil pipeline from Canada and ordered officials to complete an environmental review.

Environmentalists and tribal groups cheered the ruling by a U.S. district judge in Montana, while President Donald Trump called it “a political decision” and “a disgrace.”

The 1,184-mile pipeline would begin in Alberta and shuttle as much as 830,000 barrels a day of crude through a half dozen states–including Kansas– to terminals on the Gulf Coast.

Trump has touted the $8 billion pipeline as part of his pledge to achieve North American “energy dominance” and has contrasted his administration’s quick approval of the project with years of delay under President Barack Obama.

The pipeline was first proposed by Calgary-based TransCanada in 2008. It has become the focal point of a decade-long dispute that pits Democrats, environmental groups and Native American tribes who warn of pollution and increased greenhouse gas emissions against business groups and Republicans who cheer the project’s jobs and potential energy production.

U.S. District Judge Brian Morris put a hold on the project late Thursday, ruling that the State Department had not fully considered potential oil spills and other impacts as required by federal law. He ordered the department to complete a full review. Environmentalists and Native American groups had sued to stop the project, citing property rights and possible spills.

Becky Mitchell, chairwoman of the Northern Plains Resource Council, a plaintiff in the case, said her organization is thrilled with the ruling.

“This decision sends TransCanada back to the drawing board,” Mitchell said, calling the ruling “the results of grassroots democracy in action, winning for water and people.”

TransCanada said in a statement that it was reviewing the judge’s 54-page decision. “We remain committed to building this important energy infrastructure project,” TransCanada spokesman Terry Cunha said.

The fight over the project has spanned several presidencies and involved standoffs between protesters and law enforcement.

After years of legal wrangling, Obama rejected a permit for the pipeline in 2015. The company responded by seeking $15 billion in damages.

Trump signed executive actions to again advance construction of the project in 2017.

TransCanada had recently announced plans to start construction next year, after a State Department review ordered by Morris concluded that major environmental damage from a leak is unlikely and could quickly be mitigated. Morris said that review was inadequate.

TransCanada has promised continuous monitoring and says automatic shut-off valves would help officials quickly identify a leak or rupture.

Tom Goldtooth, executive director for the Indigenous Environmental Network said the ruling was a win for tribes, water “and for the sacredness of Mother Earth.”

He called the pipeline “the enemy of the people, the climate and life as we know it. It must be stopped.”