Want climate news in your inbox? Sign up here for Climate Fwd:, our email newsletter.

WASHINGTON — As the Trump administration has moved aggressively to roll back environmental protections and speed up oil and coal projects, it has repeatedly been blocked by courts finding that the administration did not follow longstanding rules in making its sweeping changes.

Now, a federal judge has issued a repudiation of one of President Trump’s first acts as president, his decision to allow the disputed Keystone XL oil pipeline to proceed, saying that the administration failed to present a “reasoned explanation” for the move and “simply discarded” the effect the project would have on climate change.

The decision could thrust the White House into a contentious new legal battle over climate change.

The judge’s finding quickly drew fire from Mr. Trump, who has elevated the pipeline as a prominent symbol of his administration’s effort to encourage fossil fuel use. “It was a political decision made by a judge,” said Mr. Trump on Friday, speaking to reporters at the White House. “I think it’s a disgrace.”

The ruling, by Judge Brian Morris of United States District Court for Montana, blocked construction on the 1,179-mile pipeline, which would carry 800,000 barrels a day of petroleum from the Canadian oil sands to the Gulf Coast and has, over the past decade, become a lighting rod in broader political battles over energy, the environment and climate change. While experts have long said that the substantive impact of the pipeline on jobs, climate change and the nation’s energy economy is small, it has nonetheless taken on an outsize prominence in the national discussion.