A federal judge blocked the controversial Keystone XL oil pipeline Thursday, saying the Trump administration’s justification for approving it last year was incomplete.

In a major victory for environmentalists and indigenous rights groups, Judge Brian Morris of the District Court for the District of Montana overturned President Trump Donald John TrumpOmar fires back at Trump over rally remarks: 'This is my country' Pelosi: Trump hurrying to fill SCOTUS seat so he can repeal ObamaCare Trump mocks Biden appearance, mask use ahead of first debate MORE’s permit for the Canada-to-Texas pipeline, which the president signed shortly after taking office last year.

ADVERTISEMENT

Morris’s ruling repeatedly faulted the Trump administration for reversing then-President Obama’s 2015 denial of the pipeline permit without proper explanation. He said the State Department “simply discarded” climate change concerns related to the project.

The decision once again throws into doubt the future of the 1,179-mile Keystone XL, which for much of the decade since its proposal by TransCanada Corp. has been a lightning rod in national energy policy.

The Trump administration had tried to argue that federal courts didn’t even have the right to review Trump’s approval, saying that it extended from his constitutional authority over border crossings. The court rejected that argument.

In rejecting the permit, Morris relied mainly on arguing that the State Department, the agency that analyzed the project, didn’t properly account for factors such as low oil prices, the cumulative impacts of greenhouse gases from Keystone and the Alberta Clipper pipeline, and the risk of oil spills.

“The major spills that occurred between 2014 and 2017 qualify as significant. The department would have evaluated the spills in the 2014 [environmental review] had the information been available,” wrote Morris, whom Obama nominated to the court.

The judge also said that the State Department didn’t properly justify its switch from rejecting the pipeline in 2015 under the Obama administration to approving it in 2017 under Trump.

Such a change isn’t completely prohibited, Morris said, but the State Department needs to better explain changes like its decision to disregard the climate change arguments it made in 2015.

“The department’s 2017 conclusory analysis that climate-related impacts from Keystone subsequently would prove inconsequential and its corresponding reliance on this conclusion as a centerpiece of its policy change required the department to provide a ‘reasoned explanation," Morris said, citing court precedent on similar policy changes.

“The department instead simply discarded prior factual findings related to climate change to support its course reversal.”

Speaking to reporters on Friday morning, Trump called the ruling a “political decision” and a “disgrace.”

“It was a political decision made by a judge. I think it’s a disgrace — 48,000 jobs. I approved it. It’s ready to start,” Trump said on the White House lawn.

Morris also ruled that the State Department’s conclusions about the pipeline’s impacts on endangered species need updating and that the agency may need to redo some cultural resource examinations along the pipeline’s route.

The Sierra Club, one of the leading groups in the litigation, cheered Morris’s ruling.

“Today's ruling makes it clear once and for all that it's time for TransCanada to give up on their Keystone XL pipe dream,” Sierra Club senior attorney Doug Hayes said in a statement.

“The Trump administration tried to force this dirty pipeline project on the American people, but they can’t ignore the threats it would pose to our clean water, our climate, and our communities.”

TransCanada spokesman Terry Cunha said the company is reviewing the ruling.

"We remain committed to building this important energy infrastructure project," he said. The Canadian company had planned to start construction work next year.

A State spokesman said the agency is also reviewing the ruling, but declined to comment further.

The Trump administration or TransCanada could appeal Morris’s ruling to the San Francisco-based Court of Appeals for the 9th Circuit.

That court is a frequent target of criticism by Trump and Republicans and has ruled against major Trump policies, including his travel bans for people from certain Muslim-majority countries and his ban on transgender people joining the military.

“I guess it’ll end up going to the 9th Circuit, as usual,” Trump said Friday. “We’re slowly putting new judges in the 9th Circuit. Everything goes to the 9th Circuit, everything.”

Updated on Nov. 9 at 10:07 a.m.