The Trump administration is not giving up on its effort to block Obama-era restrictions on the release of potent methane emissions at oil and gas drilling operations on public land, even after a federal judge ruled its suspension of the restrictions was illegal.

The court ruling came Wednesday at the behest of California and other states, which charged the administration is required by law to enforce the new rules intended to cut the release of 175,000 tons of the potent greenhouse gas annually, as well as reduce the emission of associated toxic pollutants. The rules took effect Jan. 17, just three days before President Trump’s inauguration. Companies have until the end of the year to comply.

The Interior Department had been delaying enforcement as it mapped out a strategy to rescind the new rules, which industry has complained are onerous. An earlier push by opponents of new methane restrictions to kill them in Congress fell short of the needed votes amid a backlash from environmentalists and landowners adversely affected by pollution from drilling.

The ruling was the latest in a series of legal setbacks for the Trump administration, as the courts find flaws in its plans for dismantling executive branch actions taken under President Obama to confront climate change.

On Thursday, department officials said they will continue to proceed with a separate proposal that would push back until January 2019 the deadline for complying with the methane rule, which the department is looking into ultimately eliminating altogether. The move leaves energy companies in limbo. If the fresh effort to suspend the rules fails, companies that were relying on it for relief could find themselves with little time to retrofit their facilities before facing penalties early next year.

The new rules cover nearly 100,000 oil and gas wells on federally owned land. The methane they leak is one of the most potent accelerators of climate change, 25 times more harmful than carbon dioxide. The new restrictions require the energy companies that own the wells to capture more of the methane and convert it into electricity.

The amount of methane escaping each year is enough to provide electricity for nearly 740,000 homes.

California noted in its lawsuit that delay in enforcing the rules was costing local communities, which are entitled to royalty revenue when the trapped methane is sold to electricity companies. The new rules are expected to generate as much as $23 million in such royalties nationwide.

U.S. Magistrate Judge Elizabeth Laporte in San Francisco ruled Wednesday that the department cannot legally postpone a rule that already has taken effect. She was unconvinced by administration arguments that it soon would have different regulations in place. She ruled that the process of replacing the rules could take months and ultimately may not stand up to legal challenges.

“No one is above the law,” California Atty. Gen. Xavier Becerra said in a statement. “As a result of this rule’s implementation, oil and gas operators on federal and Indian lands will be compelled to prevent the waste of natural gas.” He added that methane emissions “threaten the health of nearby residents and contribute to climate change.”

California’s lawsuit alleged that the administration suspended the rule five months later without reviewing any public comment or following the other requirements for such a policy change under the federal Administrative Procedure Act.

The Trump administration and congressional Republicans have been under intense pressure from oil and gas companies to scrap the rules. They say that the cost of the methane-capturing technologies would crush smaller firms, and that the bigger operations that create the most methane are trapping the gas already.

The American Petroleum Industry on Thursday applauded the administration’s persistence in working to block enactment of the rules, saying in a statement that the group welcomes its “efforts to get this right.” It noted that industry advancements already have driven down the amount of methane leakage even at a time natural gas production has surged.

The warnings of economically crushing costs conflicted with Bureau of Land Management findings that the average small business with an oil or gas operation on federal property would see its profit margin reduced by two-tenths of 1% as a result of the rules.

While many prominent Republicans continue to rail against the methane restrictions, including House Majority Leader Kevin McCarthy of Bakersfield, several conservative lawmakers have grown uncomfortable with the effort to kill the rule.

Some of these lawmakers come from states that already have strong restrictions on methane emissions in place. They are contending with pollution from drilling operations in neighboring states with more lenient policies is drifting over their borders, undermining the efforts to clean the air.

The court ruling Wednesday was just the latest legal setback for the administration in its effort to weaken federal environmental rules. Approval of a big coal mine expansion in Montana and a major gas pipeline in Florida were blocked in court recently because the administration refuses to calculate their climate impacts and the associated economic costs. The courts also found illegal an effort by the administration to delay new federal rules requiring oil companies to pay the government higher royalties.

“The courts are once again — for at least the fourth time — telling the Trump administration that it cannot simply ignore environmental laws and regulations that are already on the books,” said an email from Kate Kelly, public lands director at the Center for American Progress, a liberal advocacy group. “The administration’s ‘stay and delay’ tactics, through which it is allowing industries to bypass pollution controls and dodge royalty payments, are patently illegal.”