On his fourth full day in office, President Trump signed an executive order that was supposed to settle this whole Dakota Access Pipeline thing—no more delays due to protests, no more reconsidering the route because of environmental worries. And for a while, it seemed to work. The protest camps are gone, and the pipe has been pumping oil since March. But Thursday, a federal judge ordered a do-over on the rush-job environmental review Trump ordered back in January.

Trump came into office aiming for a blitzkrieg on environmental regulations. He got trench warfare. That's because firing from the other side of no man's land is a nimble alliance of environmental groups that have spent decades preparing for the likes of him. You have probably heard of many of them: the Sierra Club, National Resources Defense Council, EarthJustice, and so on. Others are smaller, focused on regional issues—like the Standing Rock Sioux that just won a small victory against the Dakota Access Pipeline. What they all have in common are stubborn, attrition-minded legal teams. Trump's assault is just a more bombastic version of what these lawyers have weathered under past administrations. And if there's any green left in the government by 2020, they'll be the ones responsible.

President Trump is famous for, among other things, his love of infrastructure and hatred of regulations. His January 24 executive order didn't actually target the Dakota Access Pipeline specifically. It was a sweeping declaration, meant to fast track every new, large, high priority infrastructure project through environmental review. "The White House's strategy is to deconstruct the administrative state and give favors to the fossil fuel industry," says Pat Gallagher, director of the Sierra Club's environmental law program. So these environmental NGOs are changing tack to adapt.

"This is not an abrupt change in our overarching goals," says Erik Schlenker-Goodrich, the executive director of the Western Environmental Law Center. "This is just a change in footing from offensive to defensive." Obviously, things were different under the Obama administration. Groups like the Western Environmental Law Center often worked with the government to develop policy.

For example, the Bureau of Land Management's Methane Waste Prevention Rule. Methane is an incredibly potent greenhouse gas, with more than 86 times the warming potential as carbon dioxide, plus a tendency to leak out of oil and gas drilling equipment. A lot of that drilling happens on public lands, managed by the BLM. So starting in 2008, the Western Environmental Law Center led a coalition of environmental groups in an effort to have the BLM force drillers to plug up their leaks. Their efforts paid off in November 2016—a week after Donald Trump's election night victory—when the BLM published a rule that was very close to what the groups had been pushing for.

If you happen to be an environmental news junkie, you already know that the past six months have been quite a ride in methane rule land. First came challenges from drill-happy states like Wyoming and Montana, then more challenges from the drilling industry itself. Congressional Republicans tried to rescind the rule in May, but that effort failed in the Senate. The latest twist came just this week, when the Department of Interior (which is the BLM's parent agency) announced it was delaying implementation of the rule. Schlenker-Goodrich says the Western Environmental Law Center plans to sue. Back to defense.

So far, some of that defensive action has been relatively easy. "They pulled the plug on a lot of stuff without consideration of requirements they are required to go through to change the rules," says Michael Wall, the NRDC's litigation lead. For example, on inauguration day, Trump's chief of staff ordered all federal government agencies to immediately withdraw any last minute rules made by the Obama administration that hadn't yet been published in the Federal Register. One of these rules had to do with mercury discharges from dentists’ offices. On February 1, the NRDC filed the first environmental lawsuit of the Trump era, charging that the Environmental Protection Agency didn't go through the right procedures before rescinding the rule. Long story short, the NRDC caught them on a technical foul.