A federal judge issued a major blow to President Donald Trump’s pro-fossil fuel agenda on Thursday night when he blocked construction of the controversial Keystone XL pipeline. But the ruling also served as an important reminder that, while Trump can lie about climate change in public all he wants, federal law requires his administration’s policy changes to be based on facts.

The Trump administration didn’t provide those facts when it reversed President Barack Obama’s rejection of the 1,200-mile oil pipeline in 2017, Judge Brian Morris wrote. Specifically, Trump’s State Department ignored Obama’s main justification for throwing out the project: That it would exacerbate climate change, and the United States’ standing as a world leader on the issue.

“Without explanation or acknowledgment,” Morris wrote, the Trump administration’s legal document reversing Obama’s decision “omitted entirely” any discussion of Keystone XL’s potential impact on U.S. climate leadership. “The [document] simply states that since 2015, there have been ‘numerous developments related to global action to address climate change, including announcements by many countries of their plans to do so.’” Judge Morris wrote. “Once again, this conclusory statement falls short of a factually based determination, let alone a reasoned explanation, for the course reversal.”

“An agency cannot simply disregard contrary or inconvenient factual determinations that it made in the past, any more than it can ignore inconvenient facts when it writes on a blank slate,” Judge Morris continued. He said the Trump administration didn’t provide a reasonable explanation when it asserted that approving Keystone XL would have no climate-related impacts. Instead, it “simply discarded prior factual findings related to climate change to support its course reversal.”