Just a couple of weeks ago, it looked like TransCanada’s Keystone XL pipeline was in hot water. Decades of activism, protests, and court cases were paying off, big league, as delays harmed the financial viability of the project. On Friday, the president revived the project with a stroke of his executive pen.

TransCanada had been losing in U.S. courts for the past few years: Obama-appointed federal judge Brian Morris ruled in November that President Trump failed to consider climate change when he approved the pipeline in 2017. In response, TransCanada turned to the San Francisco-based 9th Circuit Court of Appeals to override the ruling, which had required the Trump administration to draw up a new environmental impact report. But that court sided with Morris, a decision that threatened to cause the company to miss out on the 2019 construction season.

Reader support helps sustain our work. Donate today to keep our climate news free. All donations TRIPLED!

Luckily for TransCanada, the company has a friend in the White House. Trump just signed a presidential permit that allows it to sidestep the courts and “construct, connect, operate, and maintain” the line between the U.S. and Canada, in addition to maintaining a facility in Montana that will ship tar-sands crude oil into the United States.

Like many Trump administration decisions, the move is considered highly unusual. If Trump’s decision holds up, it revokes a previous permit granted by Trump — the one that had been found insufficient by Morris — and reissues it.

Grist thanks its sponsors. Become one.

“Our first response upon seeing this White House communication was that it must be an April Fools joke,” a spokesperson for the Northern Plains Resource Council, a plaintiff in the ongoing lawsuit against Keystone XL, said in a press release. “This new effort appears blatantly illegal on its face and is an unprecedented effort by a United States president to supersede the judicial branch of the United States government.”