The Trump administration suffered a legal blow on Monday when the US Court of Appeals for the District of Columbia ruled (PDF) that the Environmental Protection Agency (EPA) must enforce methane emissions rules that were finalized by the Obama administration in mid-2016.

The rules established performance standards for new drilling operations, and they required many oil and gas companies to conduct an initial survey of methane leaks by June 3, 2017. Changing finalized rules is often a lengthy and painstaking process, and Trump’s EPA Administrator Scott Pruitt announced his intention to start the reconsideration process for the rules in April. Pruitt, who sued the EPA as attorney general of Oklahoma over these rules, also announced a stay on the EPA’s enforcement of certain parts of the rules that could have lasted up to two years. Specifically, Pruitt said the EPA would not, for the time being, enforce four items specified in the rules, including regulation of low-production wells and the requirement that a professional engineer certify well vent system designs.

Environmental groups—including the Environmental Defense Fund, Natural Resources Defense Council, Environmental Integrity Project, Earthworks, the Clean Air Council, and the Sierra Club—challenged the EPA’s stay in court, however. The EPA argued that the stay was reasonable because the previous administration hadn’t given all stakeholders due opportunity to comment on certain parts of the rules’ final wording.

But two judges on the three-judge appeals court panel agreed with the environmental groups on Monday. “The administrative record thus makes clear that industry groups had ample opportunity to comment on all four issues on which EPA granted reconsideration, and indeed, that in several instances the agency incorporated those comments directly into the final rule,” the judges wrote.

The judges noted that the EPA can start the reconsideration process for the methane emissions rules at any time, but the agency still has to enforce those rules until they’re overturned. “As we have explained, ‘an agency issuing a legislative rule is itself bound by the rule until that rule is amended or revoked’ and ‘may not alter [such a rule] without notice and comment.’”

In a comment to Ars Technica, an EPA spokesperson noted, “We are reviewing the opinion and examining our options.”

The Trump administration has had a difficult time turning around methane rules promulgated by the Obama administration. Methane is a far more potent greenhouse gas than carbon dioxide, although it sticks around in the atmosphere for a shorter amount of time. Under Obama, the Department of the Interior issued rules that required oil and gas companies to track and capture methane leaking from wells on federal land. Although the House of Representatives used the Congressional Review Act (CRA) to vote those rules into obsolescence, the Senate refused to follow suit, making the Interior Department methane rules the only rules that withstood a slew of CRA motions.