A federal judge in New York has issued an emergency stay temporarily halting the removal of individuals detained after President Trump Donald John TrumpHR McMaster says president's policy to withdraw troops from Afghanistan is 'unwise' Cast of 'Parks and Rec' reunite for virtual town hall to address Wisconsin voters Biden says Trump should step down over coronavirus response MORE issued an order to ban immigrants from seven Muslim-majority countries from entering the U.S.

The move appears to mark the first successful legal challenge to the Trump administration and affects those who have arrived in the U.S. with previously approved refugee applications or were in transit with valid visas. Similar rulings were later issued in Virginia, Massachusetts and Washington state.

U.S. District Court Judge Ann Donnelly ruled in favor of a habeas corpus petition filed by the American Civil Liberties Union (ACLU) on behalf of two Iraqi men who were detained at John F. Kennedy International Airport on Friday after Trump signed his order.

Donnelly, who was nominated by former President Barack Obama Barack Hussein ObamaThe Hill's 12:30 Report - Presented by Facebook - Don't expect a government check anytime soon Trump appointees stymie recommendations to boost minority voting: report Obama's first presidential memoir, 'A Promised Land,' set for November release MORE and confirmed to her judgeship in 2015, ruled in the Eastern District of New York that "there is imminent danger that, absent the stay of removal, there will be substantial and irreparable injury to refugees, visa-holders, and other individuals from nations subject" to Trump's order.

ADVERTISEMENT

“This ruling preserves the status quo and ensures that people who have been granted permission to be in this country are not illegally removed off U.S. soil," said Lee Gelernt, deputy director of the ACLU’s Immigrants’ Rights Project.

The ruling deals with a portion of Trump's order handed down Friday, which bars Syrian refugees indefinitely and halts the resettlement of all refugees for four months as the administration reviews the vetting process.

The order also denies entry for 90 days for all individuals from Syria and six other predominantly Muslim countries: Iraq, Iran, Somalia, Sudan, Libya and Yemen.

“Clearly the judge understood the possibility for irreparable harm to hundreds of immigrants and lawful visitors to this country," ACLU Executive Director Anthony D. Romero said in a statement.

"Our courts today worked as they should as bulwarks against government abuse or unconstitutional policies and orders. On week one, Donald Trump suffered his first loss in court.”

The order Saturday evening capped off a chaotic first day following Trump's directive, as the administration moved to implement his order, with reports emerging of individuals being detained at a number of airports across the country.

The Department of Homeland Security said Trump's order would also apply to green card holders from the seven impacted countries.

"President Trump and his administration are right to be concerned about national security, but it’s unacceptable when even legal permanent residents are being detained or turned away at airports and ports of entry," Republican Sen. Jeff Flake Jeffrey (Jeff) Lane FlakeRepublican former Michigan governor says he's voting for Biden Maybe they just don't like cowboys: The president is successful, some just don't like his style Bush endorsing Biden? Don't hold your breath MORE (Ariz.) said in a statement.

A senior administration official said green card holders from the affected countries who are currently outside the U.S. will need a case-by-case waiver to return to the U.S. and green card holders in the U.S. would need to meet with a consular officer before leaving the country.

An administration official also said that Trump advisers had been in contact with the State Department and Department of Homeland Security for weeks prior to the issuing of his Friday order, arguing it affected a "relatively small" number of people.

"It’s important to keep in mind that no person living or residing overseas has a right to entry to the U.S.," the official said.

But backlash on Saturday to the order was swift from civil-rights groups,various Democratic officials and businesses, which condemned it as a departure from the U.S. tradition of accepting refugees and comparing it to Trump's campaign proposal to temporarily ban Muslim migrants.

Rep. Nydia Velázquez (D-N.Y.) slammed Trump’s executive order outside JFK, where she and fellow Rep. Jerrold Nadler (D-N.Y.) worked to secure the release of the two Iraqi men, calling it “arbitrary” and “unjust.”

Democrats also pressed the Trump administration for further explanation on the order, with Senate Minority Leader Charles Schumer Chuck SchumerMcConnell accuses Democrats of sowing division by 'downplaying progress' on election security Warren, Schumer introduce plan for next president to cancel ,000 in student debt Schumer lashes out at Trump over 'blue states' remark: 'What a disgrace' MORE (D-N.Y.) calling on the Department of Homeland Security to immediately "rescind" it.