On Tuesday, President Donald Trump signed a dramatic executive order to dismantle his predecessor’s climate change policies, with EPA Administrator Scott Pruitt and coal miners at his side. Framing it as a lifeline to coal jobs, Trump said, “We’re ending the theft of American prosperity.”

Even coal industry executives doubt that the order will lead to many new jobs. Its main actual function is to instruct Pruitt to withdraw and rewrite the Clean Power Plan, an EPA rule that requires states to make plans to cut carbon pollution from power plants. Under former President Barack Obama, the Clean Power Plan was the cornerstone of the U.S. strategy to meet greenhouse gas cutting goals contained in the 2015 Paris Climate Agreement, which may now be impossible to reach.

But while Trump can overturn Obama’s orders, he can’t erase his signature climate achievement with the stroke of a pen. When it comes to the Clean Power Plan, Trump’s words are “legally not all that relevant,” said Ben Longstreth, a senior attorney at the National Resources Defense Council, because its powers are vested in Pruitt. And for Pruitt, undoing the Clean Power Plan will mean tackling a legal task so fraught and head-spinning that it contributed to the administration delaying this order for weeks.

That’s because the EPA is legally required to regulate greenhouse gases as pollutants under the Clean Air Act, and so to undo it, Pruitt will have to write a new rule. This will entail an extensive rule-making process under the Administrative Procedure Act that includes taking public comments (the Clean Power Plan alone gathered 4.3 million) and establishing an administrative record to support why the agency reversed course. This process, which will take years, is standard. Pruitt’s longstanding antipathy to the agency he now leads is not.

According to interviews with nearly a dozen environmental lawyers, it’s clear that Pruitt is in for a pitched legal battle—the next chapter in a longstanding war over climate change policy that is already being fought in the courts.