People gather in prayer at Dallas-Forth Worth International Airport on SundayLaura Buckman / Reuters

Federal judges in four states issued orders over the weekend temporarily forbidding the removal of some individuals who had been targeted by President Trump’s executive order on refugees and immigrants, capping 36 hours of protests and chaos at major U.S. airports.

The confusion began shortly after Trump issued his sweeping executive order on Friday night. Under its provisions, Trump suspended the U.S. Refugee Admissions Program for 120 days, barred the citizens of seven Muslim-majority countries from entering the U.S. on all but certain diplomatic visas for 90 days, and permanently blocked the admission of Syrian refugees into the United States. The order does not affect travel by U.S. citizens, whether they were born in the country or later became naturalized.

The order’s sudden release and sweeping effect led to confusion and chaos at major U.S. airports as hundreds of travelers, including some lawful permanent U.S. residents with green cards, found themselves unable to enter the country. In New York, Los Angeles, Washington, D.C., and other major cities, demonstrators gathered outside international terminals to protest the executive order. Democratic members of Congress and volunteer lawyers also arrived to free people detained by U.S. customs officials. The ACLU and other legal organizations also filed lawsuits seeking temporary stays of removal in federal courts in at least four cities.

Those efforts first bore fruit in the form of a late-night order in New York City, where federal judge Ann Donnelly granted an emergency stay of removal. In the broad order, Donnelly enjoined the federal government “from, in any manner or by any means, removing individuals with refugee applications approved by U.S. Citizenship and Immigration Services as part of the U.S. Refugee Admissions Program, holders of valid immigrant and non-immigrant visas, and other individuals from Iraq, Syria, Iran, Sudan, Libya, Somalia, and Yemen legally authorized to enter the United States.” Donnelly did not limit the order’s scope to her jurisdiction, effectively making it a nationwide injunction.

Shortly after Donnelly’s order was issued, federal judge Leonie Brinkema in Virginia issued a temporary restraining order requiring the federal government to “permit lawyers access to all legal permanent residents being detained at Dulles International Airport” and forbade U.S. officials from removing the lawsuit’s plaintiffs “for a period of 7 days from the issuance of this order.” Unlike Donnelly’s broad injunction, Brinkema limited her order’s scope to Dulles International Airport, a major international airport in Virginia located about 30 miles outside Washington, D.C.

Early Sunday morning in Boston, federal judge Allison Burroughs and federal magistrate judge Judith Dein then issued an order barring the detention as well as the removal of the same groups covered by Donnelly’s injunction. Both of their injunctions apply nationwide. Federal judge Thomas Zilly issued the fourth order on Sunday morning, granting temporary stay of removal to two John Doe plaintiffs in Washington state.

In practical terms, both the Donnelly order and the Burroughs-Dein order temporarily block the federal government from removing or detaining anyone with valid immigrant or non-immigrant visas, approved refugee applications, or lawful permanent residents under the executive order’s authority. The orders also do not re-open the suspended U.S. Refugee Admissions Program, nor do they prohibit other changes to U.S. immigration policy by either Congress or the president.

The temporary rulings also mark the beginning of the legal battle over President Trump’s executive order instead of its conclusion. None of the judges addressed the broader legality or constitutionality of the order itself, instead leaving that to future court hearings where both sides can present more complete arguments to the court.

In an unusual statement, the Department of Homeland Security said it would both “comply with judicial orders” and “implement President Trump’s executive orders” at the same time, noting that “less than 1 percent” of U.S.-bound travelers were “inconvenienced while enhanced security measures were implemented.” The department also defended the executive order on its merits.

“No foreign national in a foreign land, without ties to the United States, has any unfettered right to demand entry into the United States or to demand immigration benefits in the United States,” it concluded.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.