WASHINGTON (CNN) -- President Donald Trump's seismic move to ban more than 130 million people from the United States and to deny entry to all refugees reverberated worldwide Saturday, as chaos and confusion rippled through US law enforcement agencies, airports and foreign capitals trying to grasp the US's new policy.
Trump's executive order bars citizens of seven Muslim-majority countries from entering the US for the next 90 days and suspends the admission of all refugees for 120 days.
PHOTOS: Thousands gather at airports to protest immigration ban
Travelers who fit the ban's criteria and were already in the air headed for the US on Friday afternoon when Trump signed the executive order were stopped and detained upon arrival at US airports. Others with valid visas and airline tickets were prevented from boarding planes destined for the US -- some stranded in foreign countries -- as airlines and foreign airport officials scrambled to understand and comply with the new US immigration policy.
But Saturday night, a federal judge granted an emergency stay for people who have already arrived in the United States and those who are in transit, and who hold valid visas, ruling they can legally enter the country.
Judge Ann Donnelly, who was appointed by former President Barack Obama, wrote in her decision that government could not remove "individuals with refugee applications approved by US Citizenship and Immigration Services as part of the US 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."
Anthony D. Romero, the director of the American Civil Liberties Union, said the judge recognized the potential of harm to immigrants and visitors.
"Our courts today worked as they should as bulwarks against government abuse or unconstitutional policies and orders," he said.
Among those tasked with implementing the ban, confusion reigned. US Customs and Border Protection officials received conflicting information about whether the executive order applied to US permanent residents. The White House ultimately declared the ban did apply to lawful US permanent residents, though green card holders could apply for a waiver.
The executive order was quickly decried as a "Muslim ban" by Democrats, human rights organizations and advocacy groups, who slammed Trump for instituting a policy they say cuts against US values and America's image around the world as a sanctuary for those fleeing oppression.
Trump rejected the criticism, insisting Saturday that the new policy did not amount to "a Muslim ban," like the one he called for in December 2015 in the heat of the Republican primary campaign. Trump then had called for a "total and complete shutdown of Muslims entering the United States."
Trump's actions on Friday, though, were consistent with his pledge during the campaign to stop immigration from many Muslim-majority countries, particularly those he loosely defined as historically prone to terrorism.
At John F. Kennedy International Airport, where passengers can often spot the Statue of Liberty on their descent into New York, a dozen travelers who fit the ban's criteria were detained and prevented from exiting the airport. Protesters and a handful of Democratic congressmen soon arrived to demand their release.
Among the group of people detained were two Iraqis traveling on special immigrant visas.
One of the men, Hameed Khalid Darweesh, worked with the US government for 10 years after the United States invaded Iraq. He was released early Saturday afternoon because of provisions in Trump's order that allow the secretaries of state and homeland security to admit individuals into the country on a case-by-case basis, a source with knowledge of the case told CNN.
The other man, Haider Sameer Abdulkaleq Alshawi, had been granted a visa to join his wife, who had worked for a US contractor in Iraq, and son, both of whom already live in the United States as refugees. He was released Saturday night.
At least 10 other people were in custody throughout Saturday, but it remains unclear how many others found themselves in the same situation at other US airports.
Attorneys for Darweesh and Alshawi filed a federal lawsuit Saturday morning challenging Trump's executive order, likely just the first of many challenges in the legal fight many groups plan to wage to overturn Trump's actions.
Trump on Friday said that his actions would "keep radical Islamic terrorists out of the United States of America."
"We don't want them here," Trump said as he signed the order. "We want to ensure that we are not admitting into our country the very threats our soldiers are fighting overseas. We only want to admit those into our country who will support our country and love deeply our people."
But those actions also hit green card holders, lawful permanent US residents, with heavy impact, two sources familiar with the matter told CNN. Those travelers also fell under the ban's heavy curtain, though they could apply for a waiver to enter the United States after traveling abroad.
At the Cairo International Airport, Egyptian officials on Saturday began to turn back US-bound refugees and citizens of the seven countries now barred from entering the United States.
"This is a new era we are witnessing," a Cairo airport official said.
Airlines, meanwhile, scrambled to understand the new US policy and worked to warn passengers who might be affected before they boarded their flights.
DOCUMENTS: Read the judge's ruling against part of @POTUS' immigration executive order #abc15 pic.twitter.com/CAUoD960Yg
— ABC15 Arizona (@abc15) January 29, 2017
Qatar Airways posted a travel alert on its website warning nationals of Iraq, Syria, Iran, Libya, Somalia, Sudan and Yemen that they could not travel to the United States unless they are government officials, diplomats or representatives of international organizations. The German airline Lufthansa said it was not yet "in the position to outline the effect" given the new US immigration rule had only just been announced.
Trump administration officials responded to the wide-ranging criticism, saying the United States had to take these actions so it can reform its vetting procedures and that it was built out carefully over the past few weeks during the transition.
Iran, one of the countries whose citizens were banned, slammed Trump's immigration order on Saturday as an "insult" and a "gift to extremists" and said it was considering its response.
"The US decision to restrict travel for Muslims to the US, even if for a temporary period of three months, is an obvious insult to the Islamic world and in particular to the great nation of Iran," Iran's foreign ministry said in a statement Saturday. "Despite the claims of combating terrorism and keeping American people safe, it will be recorded in history as a big gift to extremists and their supporters."
The disarray also fell against a backdrop of swift condemnation from human rights groups and national security experts.
The International Rescue Committee, a humanitarian aid and refugee assistance group, called Trump's decision to suspend refugee admissions "harmful and hasty" and noted that the US refugee program "makes it harder to get to the United States as a refugee than any other route." Refugees must undergo an extensive vetting process -- it typically takes more than two years to be admitted to the United States as a refugee.
"In truth, refugees are fleeing terror -- they are not terrorists," David Miliband, the group's president and chief executive, said in a statement. "And at a time when there are more refugees than ever, America must remain true to its core values. America must remain a beacon of hope."
The International Organization for Migration and UNHCR, the UN refugee agency, expressed concern about the provision in Trump's executive order that would prioritize Christians and other minorities fleeing persecution and conflict in Muslim-majority countries over Muslims fleeing those same countries.
"We strongly believe that refugees should receive equal treatment for protection and assistance, and opportunities for resettlement, regardless of their religion, nationality or race," UNHCR and IOM said in a joint statement Saturday.
Abed Ayoub, the American-Arab Anti-Discrimination Committee's legal and policy director, said Trump's executive order has sown "complete chaos."
Ayoub said his group has already fielded calls from people around the world impacted by Trump's executive order, including from students and legal US residents who are citizens of the seven countries banned by Trump and are now stuck overseas.
The executive order "is causing a really destructive impact on the Arab and Muslim community and on the Iranian community in the US," Ayoub said.