“If I were in the White House, I’d feel better about my position if the ban or moratorium or whatever you call it were based on an actual attack or threat,” former Attorney General Alberto R. Gonzales, who served under Mr. Bush, said in an interview. Still, he said, when it comes to noncitizens overseas, “the executive has enjoyed great deference from the courts.”

Judge James Robart, a Federal District Court judge in Seattle appointed by Mr. Bush, on Friday issued a nationwide suspension of Mr. Trump’s order while its legality was debated. The administration quickly asked the United States Court of Appeals for the Ninth Circuit to overrule the judge, but it refused early Sunday and instead ordered the government to file a brief on Monday. The quick briefing schedule indicated that the appeals court could issue a ruling on the merits of the president’s order within days.

In the meantime, refugees vetted by the government can proceed to the United States, as can any travelers with approved visas from the seven targeted nations: Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen.

Still, widespread confusion and anger were reported at overseas airports on Sunday. Unsure which orders to follow, airlines stopped even some of the people named in the lawsuits who were technically cleared to come to the country, according to a government official.

The assertion of broad latitude by the president in areas of national security resembles the struggles of the Bush years, when in the months after the Sept. 11 attacks the administration claimed sometimes sweeping power in the name of fighting terrorism.

Jack Goldsmith, who as head of the Justice Department’s Office of Legal Counsel under Mr. Bush argued that some of the initial orders went too far and forced them to be rolled back, said on Sunday that there were similarities. “But Bush’s legal directives were not as sloppy as Trump’s,” he said. “And Trump’s serial attacks on judges and the judiciary take us into new territory. The sloppiness and aggressiveness of the directives, combined with the attacks on judges, put extra pressure on judges to rule against Trump.”