Updated

Family reunions were blocked, refugees from war-torn countries were turned away and border agents detained scores of unsuspecting travelers at airports as the U.S. began a chaotic implantation of President Donald Trump's plan to fight terrorism by temporarily stopping citizens of seven nations from entering the country.

By Saturday night, a federal judge in New York had issued an order temporarily blocking the government from deporting people with valid visas who arrived after Trump's travel ban took effect. But confusion remained about who could stay and who will be kept out of the country in the coming weeks.

Among those caught in limbo: Iraqis who had been promised a life in America because of their service to the U.S. military, frail and elderly travelers from Iran and Yemen, and longtime U.S. residents traveling abroad who don't know if they will be allowed to return home.

"What's next? What's going to happen next?" asked Mohammed al Rawi, an Iraqi-born American citizen in the Los Angeles area, after his 69-year-old father, coming to visit his grandchildren in California, was abruptly detained and sent back to Iraq after 12 hours in custody. "Are they going to create camps for Muslims and put us in it?"

Large protests erupted at airports throughout the country where travelers were being held, a day after Trump signed an order banning travel to the U.S. by citizens of Iraq, Syria, Iran, Sudan, Libya, Somalia or Yemen. Trump also suspended the U.S. refugee program for 120 days.

Thousands of sign-waving people chanted and demanded that refugees be made welcome in the United States as lawyers and representatives of aid groups tried to assist people.

An official with the Department of Homeland Security who briefed reporters by phone said 109 people who were in transit on airplanes had been denied entry and 173 had not been allowed to get on their planes overseas.

No green-card holders had been ultimately been prevented from entering the U.S. as of Saturday, the official said, though several spent long hours in detention before being allowed in. Abdollah Mostafavi, 80, was released six hours after his flight arrived in San Francisco from Frankfurt.

"I'm so happy he's finally out. He says he's very tired," said his daughter Mozhgan Mostafavi, holding back tears and speaking Farsi with her father.

Hameed Khalid Darweesh, a translator and assistant for the U.S. military in Iraq for 10 years now fleeing death threats, was among at least a dozen people detained at New York's Kennedy airport their arrivals Friday and Saturday.

He walked free midday Friday after his lawyers, two members of congress and as many as 2,000 demonstrators went to the airport to try and gain his release.

"This is the soul of America," Darweesh told reporters after gaining his freedom, adding that the U.S. was home to "the greatest people in the world."

Others were less lucky. Parisa Fasihianifard, 24, arrived after a long trip from Tehran, Iran, to visit her husband, only to be detained and told she had to go home.

"She was crying and she told me she was banned to come inside and go through the gates," said her husband Mohamad Zandian , 26, an Iranian doctoral student at Ohio State University. He was hoping to get her out of the country on a late night flight to avoid her being jailed until Monday.

After an appeal from civil liberties lawyers, U.S. District Judge Ann Donnelly issued an emergency order Saturday barring the U.S. from summarily deporting people who had arrived with valid visas or an approved refugee application, saying it would likely violate their legal rights.

Staff at U.S. agencies that resettle refugees were scrambling to analyze the situation. They girded for wrenching phone calls that would have to be made to the thousands of refugees just days away from traveling to the U.S. Donnelly's order did nothing to help those people gain entry.

Several staff who spoke to The Associated Press burst into tears as they contemplated the future for people who had waited years to come into the country.

"It's complete chaos," said Melanie Nezer, policy director for HIAS, one of nine refugee resettlement agencies that work with the U.S. State Department.

Meathaq Alaunaibi, a refugee from Iraq who was settled with her husband, a son and a daughter last August in Tennessee, was had been hoping to be reunited soon with her twin 18-year-old daughters who are still in Baghdad. Now, she's unsure whether they will be able to come.

"They are so worried and afraid because they're stuck there in Baghdad," Alaunaibi said Saturday. "They are young and they are strong, but I am crying all the time. I miss them."

An Iraqi in Mosul, an Iraqi city where the Islamic State group had seized control, despaired at word that what he had thought was an imminent flight to safety in America was now canceled, indefinitely.

"If you can write to Mr. Trump or find any other way to help me reunite with my family, please, I am dying in Iraq, please," the man, whose identity was withheld because he is still in danger in Iraq, wrote back to his U.S. lawyer by email.

The order also caused confusion for longtime, legal U.S. residents traveling abroad.

Kinan Azmeh, a clarinetist born in Syria who has lived in the U.S. for 16 years, left his home in New York City three weeks ago for a series of concerts that included a date with cellist Yo-Yo Ma. Now, he doesn't know if he will be able to return home.

"I don't know what's going on," Azmeh told The Associated Press by phone Saturday from Lebanon. "It is home as much as Damascus," he said of New York City. "I really don't know how to react."

Before Trump signed the order, more than 67,000 refugees had been approved by the federal government to enter the U.S., said Jen Smyers, refugee policy director for Church World Service. More than 6,400 had already been booked on flights, including 15 families that had been expected over the next few weeks in the Chicago area from Ethiopia, Eritrea, Iran, Syria and Uganda.

The bulk of refugees entering the U.S. are settled by religious groups, who organize churches, synagogues and mosques to collect furniture, clothes and toys for the refugees and set up volunteer schedules for hosting duties. All that work ground to a halt after Trump signed the order.

In Massachusetts, Jewish Family Service of MetroWest had been coordinating a group of doctors, community leaders, a local mosque and other volunteers to resettle 15 Syrian families, including a 1-year-old and 5-year-old who arrived Tuesday.

Now, two fully outfitted apartments remain empty and it's unclear when, if ever, the other refugees will be allowed to enter, said Marc Jacobs, chief executive of the Jewish service group.

Nour Ulayyet of Valparaiso, Indiana said her sister, a Syrian living in Saudi Arabia, was sent back after arriving from Riyadh at Chicago's O'Hare International Airport on Saturday and told she couldn't enter the U.S. to help care for their sick mother. Ulayyet said some officials at the airport were apologizing to her sister, who had a valid visa.

"My mom was already having pain enough to go through this on top of the pain that she's having," Ulayyet said.

___

Associated Press writers Verena Dobnik and Karen Matthews in New York, Olga Rodriguez in San Francisco and Caryn Rousseau in Chicago contributed to this report.