WASHINGTON — President Donald Trump's aggressive push to reverse Obama-era policies is facing trouble in court.

In recent weeks, federal judges have blocked the administration's attempts to end the Deferred Action for Childhood Arrivals program (DACA), postpone a rule giving low-income families broader access to housing in wealthier neighborhoods, and delay an environmental regulation requiring oil and gas companies to reduce methane leaks.

All of these Trump policy changes have hit the same stumbling block: Courts say the administration hasn't followed the proper steps in enacting them, citing a 1940s-era law that's become a key weapon in the legal battle over the president's agenda.

Under that law, the Administrative Procedure Act, federal agencies are required to provide a reasoned justification for their policy decisions and offer the public an opportunity to weigh in when they are creating new regulations, making notable changes to existing rules, or scrapping them altogether.

Trump's critics have seized upon these requirements as a mainstay of their lawsuits against his agenda, arguing not only that the policies are harmful, but also that the administration flouted the formal rule-making process in enacting them. That's created some significant setbacks and delays for Trump's agenda — and occasionally prompted the administration to reverse course altogether.

California Attorney General Xavier Becerra. Carolyn Kaster / AP

California Attorney General Xavier Becerra, one of Trump's most prominent legal adversaries, said the White House's procedural missteps reflect its inability to follow the rules.

"The Trump administration doesn't have the right to circumvent the law, and to try to arbitrarily change it," said Becerra, who helped secure the delays to the administration's moves on DACA and the Interior Department's methane rule. "It seems to be a pattern by the president and his administration to try to act outside the law."

The legal setbacks don't mean Trump's agenda is dead. Many of the biggest cases are still working their way through the courts. And some of the rulings have made it clear that the administration could still enact the policies it wants if it follows the proper steps for rule-making.

But Trump's opponents have slowed down the president, prompting sympathetic judges to rule in their favor — much as President Barack Obama’s legal opponents did during his administration.

Such an approach can help yield quicker and more favorable results for those looking to challenge federal rule-making, legal experts say.

"One reason that advocates turn to the Administrative Procedure Act is that when the violations are clear, it seems like a pretty easy way to overturn actions, without having to involve policy," said Gillian Metzger, a law professor at Columbia University.

Jonathan Adler, director of the Center for Business Law and Regulation at Case Western Reserve University in Cleveland, said: "It is much easier to challenge an action by identifying a procedural problem than it is to try and convince a reviewing court that it's bad policy."

"If you oppose what an administration is doing, the smart way to attack it in court is to look for the procedural irregularities," Adler said.

The White House did not respond to requests for comment for this article.

Fearing the bureaucracy

From his first days in office, Trump has heralded deregulation as a top priority, and his administration has undertaken an ambitious effort to overturn Obama-era rules as swiftly as possible.

But federal regulations cannot always be quickly and easily undone, partly because of laws intended to limit executive authority and make the policymaking process deliberative, rational and democratic.

Congress passed the Administrative Procedure Act in 1946 amid the rise of communism and fascism in Europe, hoping to place checks on the vast bureaucracy created by the New Deal and "avoid dictatorship and central planning," as one legal expert explained. Under the law, federal agencies have to provide a reasoned analysis for making policy changes to avoid "arbitrary and capricious" rule-making.

That was the requirement that the federal courts cited to uphold DACA: The Trump administration had wrongly claimed that DACA was unconstitutional, they said, and could not use faulty reasoning to end the program, even if it was within its rights to do so.

"Defendants indisputably can end the DACA program," wrote U.S. District Judge Nicholas Garaufis of New York in his decision. "The question before the court is thus ... whether they offered legally adequate reasons for doing so."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Activists, young immigrants and DACA supporters march as part of a 250-mile walk to Washington, D.C., Feb. 15, 2018. SHANNON STAPLETON / Reuters

There's also a formal process for enacting new rules or changing existing ones: They're usually subject to a notice and comment period, which requires agencies to tell the public what it wants to change, allowing the public to weigh in and then responding to the commentary.

As a result, formal rule-making is typically a lengthy, involved process that can take months or even years to complete. Trump officials, like their predecessors, have tried to find alternative ways to push through change more quickly. And the administration's critics have regularly seized upon these workarounds to challenge its policy reversals in court.

Environmental setbacks for Trump

Environmental groups have been at the forefront of the legal opposition to Trump as the administration has tried to reverse course on more than 60 environmental rules, and advocates have been quick to push back on procedural grounds.

"The agencies have been in such a rush," said Brett Hartl, government affairs director for the Center for Biological Diversity, a conservation advocacy group. "If you chose to make missteps that flagrantly violate the process, instead of being patient and deliberative, it's an unforced error."

The requirement to allow public input played a key role in Trump's latest environmental setback: In late February, a federal judge in California halted the Bureau of Land Management's delay of a rule requiring oil and gas companies to cut back on methane leaks when drilling on federal land. The Obama administration estimated the rule would reduce methane emissions by 180,000 tons per year.

In his ruling, Judge William Orrick wrote that agency had "failed to provide meaningful notice and comment to the public" by illegally limiting the scope of the feedback it would consider.

Orrick, an Obama appointee, also said that the agency had failed to put forth sufficient evidence to support its delay — a more substantive violation of the Administrative Procedure Act. "It appears that BLM is simply 'casually ignoring' all of its previous findings and arbitrarily changing course," he wrote.

It was the second time the court had thwarted the BLM's attempt to delay the rule on the grounds it had failed to follow the proper procedures. Both times, the Trump administration unsuccessfully claimed it was exempt from the notice and comment requirements, arguing that it was acting to protect small oil and gas well operators.

Adler said it's not unusual for new administrations to look for shortcuts to implement their agenda and hit some speed bumps along the way. But he believes that Trump's policy agenda has suffered at times from sloppy legal work, citing the administration's failed attempt to delay another methane regulation, which a federal court also stopped last year on procedural grounds.

“When you're trying to do this many things, and you're short-staffed, and don't have a number of people with a high level of expertise, even stuff you might otherwise be able to do becomes dodgier," Adler said.

Blowback on immigration, housing, contraception

It's not just environmental rollbacks that have faced these kind of legal setbacks. Trump's wide-ranging deregulatory agenda has prompted advocates from all corners to retool their legal strategy.

"A lot more groups — consumer, civil rights, poverty — are now thinking about and becoming experts in the APA more than ever before," said Allison Zieve, director of the Public Citizen Litigation Group, a liberal advocacy organization.

In late December, a federal judge in Washington issued an injunction to stop the Department of Housing and Urban Development, run by Secretary Ben Carson, from delaying an Obama-era rule that would make it easier for low-income families to secure housing in higher-income neighborhoods.

Secretary of Housing and Urban Development-designate Ben Carson testifies during his confirmation hearing before Senate Banking, Housing and Urban Affairs Committee on Capitol Hill on January 12, 2017 in Washington. Alex Wong / Getty Images file

The Trump administration said that housing authorities needed more time to adapt to the rule, and that formal notice and comment wasn't required to suspend it. But U.S. District Judge Beryl A. Howell, an Obama appointee, said that HUD had failed to account for its decision to forgo the notice and comment period.

"This case is not about what is good housing policy," Howell wrote in her ruling. "This case is about the rule of law."

Earlier in December, district courts in California and Pennsylvania both halted the administration's efforts to roll back the Affordable Care Act's contraceptive coverage. States and advocacy groups behind the lawsuits cited sweeping legal problems, claiming that Trump's new contraceptive rule violated the Constitution's Equal Protection Clause and the Civil Rights Act, among other statutes.

But in their recent rulings, the courts focused on narrower concerns, zeroing in on the administration's decision to skip notice and comment for Trump's directive, which expands employers' ability to deny birth control coverage for religious or moral reasons.

"Plaintiffs face potentially dire public health and fiscal consequences as a result of a process as to which they had no input," wrote Judge Haywood Gilliam of the U.S. District Court in Northern California, another Obama appointee. Judge Wendy Beetlestone of the U.S. District Court in eastern Pennsylvania cited similar procedural problems, though she said Trump's contraceptive rule was illegal on other grounds as well. (The Trump administration says it had "good cause" to skip notice and comment.)

Similarly, in their lawsuit over DACA, a group of Democratic attorneys general argued that ending the program would be unconstitutional, but they also claimed that the manner in which Trump acted was illegal under the Administrative Procedure Act. And it was on procedural grounds that two federal judges ruled in the DACA supporters' favor.

"When a court is deciding whether to grant a preliminary injunction, it generally will want to act within a pretty quick time frame," said Brianne Gorod, chief counsel for the Constitutional Accountability Center, a liberal think tank and advocacy group. "If there's a blatant violation of some procedural requirement, ruling on that ground can be the easier and simpler way for the court to go."

Obama face similar setbacks

Gorod notes that conservatives used similar tactics to go after the Obama agenda with some degree of success: In 2015, a federal court in Texas initially halted the administration's Deferred Action for Parents of Americans (DAPA) for failing to go through notice and comment. Another Texas court blocked Obama's guidelines for transgender student' access to bathrooms for similar reasons.

But Gorod, whose organization supported Obama's moves on DAPA, points out that the most prominent cases emerged toward the end of the Obama administration, after the president had already spent years trying to enact policy through Congress and started leaning more heavily on executive authority.

President Barack Obama addresses the Congressional Black Caucus Foundation's 46th annual Legislative Conference Phoenix Awards Dinner in Washington, Sept. 17, 2016. Yuri Gripas / Reuters file

Legal experts said the issue reflects a broader problem with Washington: Congress has been unable or unwilling to act, and presidents have increasingly stepped into the breach, prompting courts to push back to contain executive overreach.

On occasion, the legal challenges have prompted the Trump administration to backtrack entirely.

In late February, HUD said that it would reinstate the fair-housing rule that it unsuccessfully had tried to suspend. In February 2017, the Natural Resources Defense Council sued the Trump EPA for withdrawing an Obama-era regulation of mercury disposal, citing its failure to provide adequate notice and comment. The administration ultimately backtracked and restored the rule before the courts had even weighed in.

But in other cases, the battle is far from over.

The Trump administration tried unsuccessfully to get the Supreme Court to hear its DACA case, but it will continue to seek a reversal in the lower courts. And in February, the administration announced that it would formally revise the regulation for methane emissions on federal land, rather than simply delay it.

Even if their victories prove to be short-lived, liberal advocates said they're still worth fighting for.

"With procedural challenges, you're trying to get the government to follow the law," said John Walke, an attorney for the Natural Resources Defense Council. "But strategically it's also to slow their agenda, to buy time, or force them back into a lengthy public process where you live to fight another day."