WASHINGTON ― President Donald Trump’s executive order targeting Muslims and refugees led to chaos in the hours after he signed it, as refugees and immigrants arrived at U.S. airports only to be detained or told they couldn’t enter the country and businesses had to scramble to adjust to the new policy.

“We are hearing that last night a lot of people were turned away,” said Abed Ayoub, legal director of the American-Arab Anti-Discrimination Committee. “It’s had a direct impact on a lot of people.”

The order, which Trump signed Friday afternoon, bans Syrian refugee resettlement in the U.S. indefinitely. It will also shut down the entire refugee program for 120 days and bar all immigrants and visitors from seven Muslim-majority countries ― Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen ― from entering the U.S. for at least 90 days.

The order goes far beyond refugees or tourists ― it means that about 500,000 green card holders who reside in the U.S. but are originally from one of the seven countries will need a waiver to return to their homes, White House officials said Saturday. It also applies to people from the seven countries who hold dual citizenship and are not U.S. citizens. This means that people of both French and Yemeni nationality, for example, would be denied entry.

Coming in the late hours of Friday, and with little apparent consultation with other agencies and groups prior to its publication, the president’s order has created havoc and confusion among those tasked with overseeing entry into the country, to say nothing of the people actually trying to enter the U.S.

Stephanie Keith/Getty Images Protesters demonstrate against President Trump's immigration ban at John F. Kennedy International Airport on Jan. 28.

On Saturday afternoon, nearly 24 hours after Trump signed the order, a White House official said the administration was still working to determine the exact meaning of a very important piece of language: “in transit.” The order says that authorities may “determine to admit individuals to the United States as refugees on a case-by-case basis” in instances “when the person is already in transit and denying admission would cause undue hardship.”

Because the precise meaning of that language is not clear, however, many people who were in transit when the order was signed have been detained and in some cases barred from entering the country.

In the hours after Trump signed the order, government authorities detained two Iraqis at New York’s John F. Kennedy International Airport, The New York Times reported. One of the men, Hameed Khalid Darweesh, worked for the U.S. government for 10 years as an interpreter. He was detained upon landing at JFK on Friday night, but his wife and children were let through, a former colleague of Darweesh’s told The Huffington Post. Darweesh was released the following day.

The other detained man, Sameer Abdulkhaleq Alshawi, was coming to the country to join his child and wife, who had worked for a U.S. government contractor, The Washington Post reported.

Lawyers for the two men told CNN they have filed a lawsuit against the president and the government over their detention. The action in federal court seeks a writ of habeas corpus — an order declaring their detention illegal — and the certification of a class action covering any immigrants and refugees denied admission at ports of entry across the country, according to the complaint filed in New York.

PAUL J. RICHARDS/AFP/Getty Images People gather at the international arrivals area of Washington Dulles International Airport on Jan. 28 to show their support for immigrants and refugees.

Google, meanwhile, told traveling staff members to come back to the U.S., BBC News reported.

And refugee organizations began notifying volunteers that the families they planned to help were no longer on their way. Alisa Wartick, 36, said she and a group of 38 people in her neighborhood had co-sponsored a Syrian refugee family through the organization Refugee One in Chicago.

The family ― a mother, father and 16-month-old daughter ― was supposed to arrive on Monday to join the woman’s parents and siblings. The co-sponsorship group had already furnished their apartment, and met the family via FaceTIme so they could see their new home, which they now may never see again.

“Just imagining raising a child in a refugee camp environment and then being told you could see your family again, you could be reunited with your mom and your daughter’s grandma and being told ‘No, sorry, you’re three days too late for that’ ― I can’t imagine what that’s like,” Wartick said.

Church World Service, one of the organizations that handles refugee resettlement, had been planning to welcome 212 refugees next week, 164 of them joining family members already in the United States, according to a spokeswoman. Those 212 refugees are no longer expected to arrive.

Protesters gathered at airports throughout the country on Saturday to demonstrate against Trump’s executive order. Hundreds crowded JFK’s Terminal 4, chanting “Love trumps hate!” and “No hate, no fear, refugees are welcome here!” BuzzFeed broadcast the protest live on Facebook.

We are streaming live from the JFK airport protest happening tonight: https://t.co/R5TWxk7oZ7 pic.twitter.com/9ReUrv0gNu — BuzzFeed News (@BuzzFeedNews) January 29, 2017

Large crowds were also reported at San Francisco International Airport, Chicago O’Hare International Airport and Washington Dulles International Airport.

Police at SFO say there are probably 1,000 people here protesting Trump's #MuslimBan now pic.twitter.com/shUq5mAIGC — Priya Anand (@Priyasideas) January 29, 2017

Though Trump, on the campaign trail, had pledged to stop refugees from certain Muslim-majority countries from entering the United States, there was some skepticism that he would actually follow through on the proposal. Business groups had warned against it, as did religious organizations, including some with traditionally conservative political leanings.

Moreover, congressional Republicans spoke out over the summer against any policy that would bar people from entering the United States based on their religion. House Speaker Paul Ryan (R-Wis.) was one of those critics. But on Friday evening, he offered a statement of support for Trump’s proposal.

The ripple effects of the executive order make clear the difficulty in taking a blunt campaign promise and applying it to real-world governance, with seemingly unforeseen outcomes and immediate, frightening disruption in people’s lives. People took to Twitter to share the uncertainty now surrounding their Syrian colleagues and friends.

Just hearing from my Syrian refugee friends: There are Syrians who were at the airport, visa and ticket in hand. They sold everything, /1 — Jessica Goudeau (@jessica_goudeau) January 28, 2017

This was the talented Iraqi guy who helped run @latimes in Baghdad during worst years of war. Now in US. No words. https://t.co/FFRvQjnm8E pic.twitter.com/SdHtELNVav — Borzou Daragahi (@borzou) January 28, 2017

In other cases, people who made it to safety in the United States are now having trouble meeting family members from their home countries. Mohammed Al Rawi, who risked his life working for the Los Angeles Times bureau in Baghdad, moved to Long Beach, California, in 2010. His 69-year-old father was leaving Qatar to fly to Los Angeles to visit him Friday night when a U.S. official stopped him and informed him that Trump had “canceled all visas,” Al Rawi wrote on Facebook.

U.S. officials then detained Al Rawi’s father in an unknown location and confiscated his passport, making it impossible for Al Rawi to book him a hotel in Qatar to sleep for the night, he said. His father’s phone died, so he has not been able to get in touch.

Meathaq, 45, and Mahmoud, 49, of Baghdad just arrived in Knoxville, Tennessee, in August with their 5-year-old son and 15-year-old daughter. But they have twin 18-year-old daughters still living in Iraq.

Thanks to Mahmoud’s work as a translator for the U.S. Army, they were able to get a special immigrant visa. The process for approving their visas took four years, beginning when they first applied in 2012. By that time their daughters were over 18, which meant the U.S. government required greater processing. Now the twins are stuck in Baghdad, and their parents fear they will not be able to reunite with them. (Both Meathaq and Mahmoud withheld their last names out of concern for their twin daughters’ safety.)

“I am crying all the time, especially after the new law from President Trump,” Meathaq said. “I miss them and the situation in Iraq is so bad and I don’t know what to do to help.”

Courtesy of Meathaq Meathaq, a recent arrival from Baghdad, participated in the Women's March on Jan. 21, 2017. Her twin daughters remain in Iraq.

Even the film industry has felt the impact. The executive order will prevent Iranian film director Asghar Farhadi from traveling to the Oscars ceremony next month. Farhadi’s “The Salesman” was nominated in the Best Foreign Language Film category this year. Farhadi became the first Iranian director to win an Oscar in that category in 2012. Iranian actress Taraneh Alidoosti, a co-lead in “The Salesman,” said this week that she would boycott the Oscars over the visa ban.

Trita Parsi, president of the National Iranian American Council, shared several stories on Twitter of individuals affected by the ban, including people with green cards to be in the U.S. The Huffington Post is working to verify those stories.

Zane Shami, a naturalized U.S. citizen who has lived in the U.S. for over two decades, said he’d been expecting his mother, who is 67, to arrive to live with him on Feb. 7.

Shami’s mother was born in Syria but has been living in Kuwait, where Shami was born and where his siblings live, since the civil war in her native country leveled her town. She was approved to come to the U.S. as a refugee after extensive vetting, Shami said. But now she’s unable to move here as planned, or even to visit.

“I’ve done everything right. I did the checklist,” Shami said. “There’s no reason my mom can’t come here. It’s very un-American to say that we’re going to ban her just because she has a Syrian passport. That doesn’t sound American to me.”

Here's another sad case of an Iranian green card holder being denied entry to the United States...#MuslimBan@BahmanKalbasi @ASE @rezaaslan pic.twitter.com/W3ycAYqTym — Trita Parsi (@tparsi) January 28, 2017

NBC Philadelphia reported that two Syrian families were blocked from entering the United States in Philadelphia and were sent back on a flight home.

Ayoub said that given confusion over whether the executive order applies to people who hold green cards, and that some have been detained for hours before being released.

Nashwan Abdullah, 25, of Damascus, Syria, is on track to finish his master’s degree in music performance at Indiana University of Pennsylvania in May. Now that Trump has banned immigration from Syria, Abdullah’s not sure if he’ll be able to stay. He had been hoping to apply for a 12-month work visa available to foreign students, but does not know if this is possible any longer.

Abdullah is sure, however, that he will not return to Syria. He does not want to be drafted into the Syrian military, or deal with the danger and scarcities of basic necessities in the Syrian capital.

“Of course I am afraid to go back. It’s a war zone. It’s an unsafe, bad situation,” he said.

There is one glimmer of hope for Abdullah: He is Catholic, so he is not sure if the ban is “going to include me or not.”

This story will be updated as more information becomes available.

Willa Frej, Daniel Marans, Sam Stein and Travis Waldron contributed reporting.