A federal judge in Montana granted an injunction to stop construction on the TransCanada Keystone XL pipeline on Thursday.

Brian Morris, the district judge in Montana, wrote a 54-page order addressing allegations from Indigenous and environmental groups, alleging the U.S. Department of State made several violations when it approved the $8 billion, 1,900-kilometre project.

In August, Morris ruled that the State Department was obligated to "analyze new information relevant to the environmental impacts of its decision" to issue a permit for the pipeline last year.

Stephan Volker, who represented the Indigenous Environmental Network called the order a win.

"When the Trump administration reversed course it failed to address those factual findings," Volker said. "Under a number of different laws in the states administration has to explain the reasons why it feels it can change a decision when it was made contrary to actual findings in the past."

Volker said the Keystone XL project violated several environmental laws and emphasised that the Trump administration failed to address a key flip flop from a previous ruling by former Secretary of State John Kerry in 2015.

During Barack Obama's presidency, Kerry ruled that the project wasn't in the public interest, citing climate change issues and alleging the project wouldn't be the economic driver it promised to be.

Volker said the judge's ruling means the project has been set aside and can't proceed — but the order can be appealed.

Promising or problematic?

Greenpeace Canada climate campaigner Mike Hudema said the ruling is a significant setback for TransCanada's Keystone XL project and a big win for Indigenous groups and environmental defenders.

"This should also be huge warning sign to the Liberal government about the inevitable legal hurdles they will face if they continue to rush and curtail the Trans Mountain assessment process," he wrote in a statement. "We can't afford new fossil fuel infrastructure if we want to save the planet."

A protester in Vancouver holds a photo of Prime Minister Justin Trudeau covered in oil during a protest in May against the Trans Mountain pipeline expansion. (Darryl Dyck/Canadian Press)

He added that halving fossil fuel emissions in the next ten years means work on any new pipelines must come to a full stop in order to avoid a "climate catastrophe."

In contrast, Dennis McConaghy, a former executive at the Calgary-based TransCanada Corporation, said the ruling is bad news for Canada but guessed that the ruling will be looked at and reversed in a higher court.

"This would be very, very problematic and put even more pressure on a Trudeau government to get the Trans Mountain pipeline built," he said. "Canadians should hope that this thing is vigorously litigated and reversed."

'Not over' for Indigenous activist

Dallas Goldtooth has been following the twists and turns of the project for years, and the Keep It In The Ground campaign organizer for the Indigenous Environmental Network said he was flustered because the ruling was "huge news."

"We keep killing it, and it keeps coming back from the dead," said Goldtooth, who is a Mdewakanton Dakota and Diñe man.

Goldtooth, one of the plaintiffs represented by Volker, said if necessary he would show up at a construction site with judge Morris' ruling to stand his ground and make sure it is followed.

"It's not over for us, we're just going to keep on going ahead," he said.