NEW YORK (AP) — 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 conduct a new 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 (1,900 kilometer) pipeline would begin in Alberta and shuttle as much as 830,000 barrels a day of crude through a half dozen states 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 Trump administration has not said whether it would appeal the new ruling. The State Department said it was reviewing the decision, but declined further comment, citing ongoing litigation.

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 new review that addresses issues that have emerged since the last environmental review was completed in 2014.

New topics include the cumulative effects on greenhouse gas emissions of Keystone XL and a related pipeline that brings oil from Canada; the effects of current oil prices on the pipeline's viability; updated modeling of potential oil spills; and the project's effect on cultural resources of native tribes and other groups along the pipeline's route.

The review could take up to a year to complete.

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.

Environmental groups declared victory and predicted the long-delayed project will never be built.

The court ruling "makes it clear once and for all that it's time for TransCanada to give up on their Keystone XL pipe dream," said Doug Hayes, a senior attorney with the Sierra Club, the nation's largest environmental group.

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, a Minnesota-based advocacy group that also is a plaintiff in the case, 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."

Online Public Information File

Viewers with disabilities can get assistance accessing this station's FCC Public Inspection File by contacting the station with the information listed below. Questions or concerns relating to the accessibility of the FCC's online public file system should be directed to the FCC at 888-225-5322, 888-835-5322 (TTY), or fccinfo@fcc.gov.