Maher Salam is seen at Dulles International Airport in Virginia with his mother, Rukaieh Sarioul, a Syrian citizen who was stuck in Saudi Arabia for a week because of President Trump’s entry ban but arrived in the United States on Saturday. At right is Salam’s wife, Abeer Mohideen. Salam and Mohideen are doctors. The family lives in Cleveland. (Michael Miller/The Washington Post)

Most of the more than 40 people from Iran who arrived at Logan International Airport on Saturday afternoon were ecstatic, the first large wave of travelers to come to the United States a week after President Trump banned them from entering the country.

The decision late Friday by a federal judge to temporarily halt Trump’s denial of entry to travelers from seven majority-Muslim countries had created an opening — and in a frantic race on the other side of the globe, thousands of people rushed to book flights to the United States, uncertain of how long the opportunity would last.

Flights carrying previously barred travelers reached Logan on Saturday afternoon, with more expected at airports across the country starting Sunday.

But amid the euphoria and excitement, the Jalili family of Iran passed through the checkpoints at Logan and onto American soil in a heartbroken state, even though their dream to emigrate — 10 years in the making — had been revived by the federal judge.

At the last minute, after passing through security in the Tehran airport, officials would not let their oldest daughter, 19-year-old Helya, board the Boston-bound plane. She was kept back with about 15 others whose names were called. They got no explanation.

(Natalie Jennings,Bastien Inzaurralde,Alice Li/The Washington Post)

After a quick and agonizing decision, and with Helya’s urging, the rest of the family boarded the plane with heavy hearts. They spent most of the flight crying, next to Helya’s empty seat.

The family’s plight was emblematic of the confusion that continued Saturday — even as government officials and airlines tried to restore normalcy after a week of chaos surrounding the entry ban — amid protests and legal challenges, and after the issuance of the nationwide stay.

“We were very, very sad last night,” said Hamid Jalili. “If [my daughter] will come here tomorrow, our gladness will be complete.”

Only a small number of citizens of the seven Middle Eastern and North African countries covered in Trump’s banning order arrived at U.S. airports Saturday, but attorneys representing them expected a flood in the coming days.

Becca Heller, the director of the International Refugee Assistance Project (IRAP) in New York, said considerable problems remained as citizens of the seven nations — Libya, Iran, Iraq, Yemen, Somalia, Sudan and Syria — trickled Saturday into the United States.

“It’s just completely unclear what coordination is happening.­

. . . What we’re witnessing is the Wild West of immigration law,” she said. “And the people who are suffering are the people who desperately need to come to the U.S.”

She said her group is hearing reports from travelers of inconsistencies in how airlines are complying with the judge’s order; it appeared that some low-level employees of some carriers were still unaware Saturday that a stay of Trump’s ban had been issued.

Nevertheless, Heller urged travelers to book flights soon, given the Trump administration’s impending challenge of the stay, which was issued by U.S. District Judge James L. Robart in Seattle but affects the entire nation.

“There’s a window right now. No one knows how long the window will last,” Heller said. “People that need to get to the United States for an urgent reason should get on a plane as soon as possible.”

IRAP was preparing packets of information for travelers to present to authorities if they encounter any problems. The documents explain their right to travel to the United States.

A number of airlines — including Qatar Airways, Etihad Airways, Air France and Lufthansa — announced that they would allow travelers from the seven nations to board flights after the State Department said Saturday that it was restoring visas that had been revoked under Trump’s Jan. 27 executive order.

And Department of Homeland Security workers were told at the start of their shifts to start processing travelers with visas as normal.

The Jalili family and others at Logan described few problems when they arrived in the country, a marked change from the previous weekend, when some travelers from countries named in the banning order were detained for hours and some sent out of the country on return flights.

Hamid and Bahareh Jalili and two of their daughters, Helya and Hanya, 13, had been issued immigrant visas to join Hamid’s brother, who moved to the United States 40 years ago, and the brothers’ recently widowed mother.

They had spent most of the first leg, from Tehran to Frankfurt, Germany, in shock after being separated from Helya.

In Frankfurt, they received text messages from Helya saying that their names had been called just after they left — officials had wanted to keep them, too. But the Seattle judge’s decision, which came before they left for Boston, had shifted the situation, and they were hopeful again, Hamid said in halting English.

Arriving in Boston, Bahareh with tears in her eyes and Hanya looking stunned, the family was greeted by a small but enthusiastic crowd of well-wishers, lawyers and relatives of other passengers.

The family applied for visas in 2004. The visas came through at the end of October, and the family decided to leave at the end of January. Then came Trump’s entry ban.

Brothers Reza and Hamid had not seen each other in three years. Hamid could not attend their father’s funeral last year. He worried that his mother, 84 and with a heart ailment, would die before he could reach the United States.

Reza had tried to reassure Hamid when Trump’s executive order was announced. “I said, ‘There’s no way they can take this away from you.’ ” Now, he said, “I have egg on my face.”

Asked whether the situation had changed his view of the United States, Reza Jalili said: “I’ve been here 40 years. You cannot change my view now.”

He said he was upset that such a thing could happen in what he called a country of immigrants, “but at the same time, I want to thank the other half of America that has nothing to do with this.”

The Jalilis were not the only travelers who had to scramble to get on flights.

Syrian national Nael Zaino had spent three days at airports, unable to sleep because his cellphone kept buzzing with the latest news about Trump’s temporary ban on refugees and the U.S. courts’ reaction to the ban.

Zaino’s wife and 18-month-old son had received asylum and entered the United States last year; now he was increasingly desperate to join them.

At the airport in Istanbul, where he has lived since fleeing Syria two years ago, Zaino was told a half-hour before his flight was scheduled to leave that he would not be allowed on. He had already twice been barred from boarding U.S.-bound flights.

He went to find a place to sit and wait for his next chance, when his name was called. The court had just reversed the U.S. entry ban and Zaino would be allowed to fly. He grabbed his bags and ran full-tilt to the gate, the last to board the Boston flight.

He was still nervous when he landed, worried that he would be sent back.

It sank in that he was safe, he said, only when a customs officer handed his passport back to him.

“He told me go start your new life with your son. Choose a very good doctor for him, a very good school,” Zaino said in accented but fluid English, choking back emotion.

As some waited for loved ones at airports, protesters in New York, Miami, the District and other cities around the world turned out to express anger at the entry ban. Hundreds gathered near the White House in Lafayette Square.

Many in the crowd wore Statue of Liberty foam crowns or displayed posters with the Statue of Liberty’s face plastered with the words: “Silence Equals Violence.”

Jessica Fix, 27, of the District, attended Saturday’s protest at the White House just as she did the previous week. She said she is Jewish and that her ancestors had migrated to the United States from Russia.

“In my opinion, this is how the Holocaust started,” said Fix, a senior at the University of Baltimore. “It’s important to come out and fight for people who are too scared to.”

Back at Logan Airport, immigration lawyer Susan Church spent the afternoon keeping a record of arriving foreigners and offering pro bono services from American lawyers.

As people from the listed countries walked out of customs and into Logan’s lobby, lawyers and others cheered and offered them flowers, pastries and gift bags.

Church welcomed most of them, shaking their hands and saying, “I’m sorry.”

Kate Jubboori, from the Boston suburb of Hopkinton, stopped at Logan just before 6 p.m. to drop off goody bags for arriving migrant children. Jubboori, whose father-in-law migrated to the United States from Iraq in the 1960s, said the family had toys left over from her son’s fourth birthday party earlier Saturday. She had printed labels that said “Welcome home” on the small gold-colored bags. Asked why she made the effort, Jubboori said she was “just being a human.”

Ian Shapira and Abigail Hauslohner in Washington, Vera Haller in New York, Steve Freiss in Detroit, Leah Sotille in Portland, Ore., Lornet Turnbull in Seattle, Camille Pendley in Atlanta, Mark Guarino in Chicago, Francisco Alvarado in Miami and Rob Kuznia contributed to this report.