Federal appeals judges on Friday peppered lawyers on both sides with questions in a fight over President Barack Obama’s move to shield millions of immigrants from deportation.

The interrogation came as the 5th Circuit Court of Appeals panel held a special hearing in a closely watched case that is holding up Obama’s immigration action.

A coalition of 26 states, led by Texas, sued to block the plan. The hearing was on an appeal of a Texas judge’s injunction.

The Justice Department argued that Texas has no legal standing in the matter. Texas’ solicitor general countered that granting legal status to undocumented immigrants will be costly for Texas.

The judges did not rule and took the case under advisement.

Throughout the hearing chants and drumming by pro-immigrant protesters outside the courthouse filtered into the packed courtroom.

U.S. District Judge Andrew Hanen in Brownsville, Texas, granted a preliminary injunction on Feb. 16 at the request of the states that oppose Obama’s action. Hanen’s rulings have temporarily blocked the Obama administration from implementing the policies that would allow as many as 5 million people in the U.S. illegally to remain.

The Justice Department appealed his ruling. Friday’s special hearing — which took more than two hours — was lively, with two of the judges focusing on whether an individual state can seek to undo a federal immigration policy.

Benjamin Mizer, the Justice Department’s principal deputy assistant attorney general and a former Ohio solicitor general, called Texas’ suit unprecedented and argued that immigration policy is a domain of the federal government.

“If Texas is right, it could challenge an individual’s right to seek asylum,” Mizer said. “The states do not have standing in the downstream effects of a federal immigration policy.”

Scott Keller, Texas’ solicitor general, argued that Obama’s immigration move has direct consequences because Texas will incur the costs of providing drivers’ licenses, education and health care to immigrants granted permission to stay in the United States.

“This is one of the largest changes in immigration policy in the nation’s history,” Keller said. “What this is doing is conferring a legal presence” to people now living illegally in the country, he said. “We absolutely have a stake.”

Judges Jennifer Elrod, appointed by President George W. Bush, and Stephen Higginson, an Obama appointee, often interrupted the legal arguments with queries. Judge Jerry Smith, appointed by President Ronald Reagan, was the third member of the randomly chosen panel.

Elrod seemed skeptical of the Justice Department’s arguments, while Higginson questioned those of Texas.

Obama announced the executive orders after the November midterm elections, saying inaction by Congress had forced him to make sweeping changes to immigration rules on his own.

The first of Obama’s orders — to expand a program protecting young immigrants from deportation if they were brought to the U.S. illegally as children — had been set to take effect Feb. 18.

His other major action would have been to extend deportation protections to parents of U.S. citizens and permanent residents who have been in the country for several years. That provision was slated to take effect May 19. The injunction halted both.

Both sides left feeling optimistic.

“This is about a 26-state coalition upholding the rule of law,” Keller said, noting that “the arguments went very well” and calling the judges, “very engaged” and “very well prepared.”

Nora Preciado, staff attorney with the National Immigration Law Center based in Los Angeles, which filed a brief in support of the federal government’s case, also left the hearing feeling encouraged.

“We remain very confident that these programs will be implemented,” Preciado said as about 50 immigrants and supporters demonstrated in a nearby park.