U.S. President Barack Obama speaks at the Summit on Cybersecurity and Consumer Protection at Stanford University in Palo Alta, California February 13, 2015. REUTERS/Kevin Lamarque

By David Ingram and Mica Rosenberg

NEW YORK (Reuters) - President Barack Obama's administration faces a difficult and possibly lengthy legal battle to overturn a Texas court ruling that blocked his landmark immigration overhaul, since the judge based his decision on an obscure and unsettled area of administrative law, lawyers said.

In his ruling on Monday that upended plans to shield millions of people from deportation, U.S. District Judge Andrew Hanen avoided diving into sweeping constitutional questions or tackling presidential powers head-on. Instead, he faulted Obama for not giving public notice of his plans.

The failure to do so, Hanen wrote, was a violation of the 1946 Administrative Procedure Act, which requires notice in a publication called the Federal Register as well as an opportunity for people to submit views in writing.

The ruling, however narrow, marked an initial victory for 26 states that brought the case alleging Obama had exceeded his powers with executive orders that would let up to 4.7 million illegal immigrants stay without threat of deportation.

"It's a very procedural point – that he did this too quickly," said Michael Kagan, a law professor at the University of Nevada, Las Vegas.

Hanen's ruling left in disarray U.S. policy toward the roughly 11 million people in the country illegally. Obama said on Tuesday he disagreed with the ruling and expected his administration to prevail in the courts.

The U.S. Justice Department was preparing an appeal of Hanen's temporary injunction to the 5th U.S. Circuit Court of Appeals in New Orleans, Obama said. The court could consider an emergency request to block Hanen's ruling, potentially within days, although most of the 23 judges on the court were appointed by Republican presidents.

There was no consensus among lawyers with expertise in administrative law and immigration law on whether Hanen would be reversed on appeal. But they said the judge was wise to focus on an area of administrative law where legal precedent is sometimes fuzzy.

In the near term, the narrow approach allowed Hanen to issue a temporary injunction barring federal agencies from putting Obama's plans into place. An appointee of President George W. Bush, Hanen had previously criticized U.S. immigration enforcement as too lax.

BRAKE ON PRESIDENTIAL ACTION

Hanen's ruling turned on the Administrative Procedure Act's requirement that a proposed rule or regulation appear in the Federal Register so people have a chance to comment. The Federal Register is a daily journal of U.S. government proceedings.

The "notice and comment" requirement acts as a brake on all presidents, slowing their plans by months or years.

The requirement, though, does not apply to "interpretative rules" or general statements of policy, an exception that Justice Department lawyers said applied to Obama's announcement in November. Rules that must be submitted for notice and comment are sometimes known as "legislative rules."

For Hanen, the pivotal question became whether the new rules, such as granting work permits to potentially millions of illegal immigrants, was binding on federal agents or merely general guidance. He ruled that they were binding, and that Obama should have allowed for notice and comment.

Lawyers with expertise in administrative law said there was little guidance from the U.S. Supreme Court on what qualifies as a rule that needs to be published, leaving disagreement among lower courts and a grey area for Hanen to work in.

"The case law as to what qualifies as a legislative rule is remarkably unclear," said Anne Joseph O'Connell, a University of California Berkeley law professor.

LENGTHY PROCESS LOOMS

O'Connell said it was hard to predict how the appeals court would rule in the end, although she thought it was likely the court would lift Hanen's temporary injunction and allow the Obama administration to begin putting its program in place.

The subject is not strictly partisan, she said, because sometimes a liberal interest group might favor a strict requirement for notice and comment.

An appeal before the 5th Circuit could take months, as lawyers file written briefs and the court holds oral argument and comes to a decision.

The appeals court could also consider other questions, such as whether the states that brought the lawsuit had what is known as standing to sue or whether Obama violated the clause of the U.S. Constitution that requires presidents to "take care that the laws be faithfully executed."

Story continues