WASHINGTON — Twice rejected for U.S. visas, an all-girls robotics team from Afghanistan arrived in Washington early Saturday after an extraordinary, last-minute intervention by President Trump.

The six-girl team and their chaperone completed their journey just after midnight from their hometown of Herat, Afghanistan, to enter their ball-sorting robot in the three-day high school competition starting Sunday in the U.S. capital. Awaiting them at the gate at Washington Dulles International Airport were a U.S. special envoy and Afghan Ambassador Hamdullah Mohib, who described it as a rare moment of celebration for his beleaguered nation.

“Seventeen years ago, this would not have been possible at all,” Mohib said in an interview. “They represent our aspirations and resilience despite having been brought up in a perpetual conflict. These girls will be proving to the world and the nation that nothing will prevent us from being an equal and active member of the international community.”

In the short time since their visa dilemma drew global attention, the girls’ case has become a flashpoint in the debate about Trump’s efforts to tighten entrance to the U.S., including from many majority-Muslim countries. Afghanistan isn’t included in Trump’s temporary travel ban, but critics have said the ban is emblematic of a broader effort to put a chill on Muslims entering the U.S.

The girls’ story has also renewed the focus on the longer-term U.S. plans for aiding Afghanistan’s future, as Trump’s administration prepares a new military strategy that will include sending more troops to the country where the U.S. has been fighting since 2001. Defense Secretary Jim Mattis said Friday the strategy was moving forward but “not finalized yet.”

Trump’s personal intervention earlier in the week using a rare “parole” mechanism to sidestep the visa system ended a dramatic saga in which the team twice traveled from their home in western Afghanistan through largely Taliban-controlled territory to Kabul, where their visa applications were denied twice.

The U.S. won’t say why the girls were rejected for visas, citing confidentiality. But Mohib said that based on discussions with U.S. officials, it appears the girls were rebuffed due to concerns they would not return to Afghanistan. It’s a fate that has beset many Afghans seeking entry to the U.S. in recent years as continuing violence and economic challenges lead many to seek asylum in America, or to travel through the U.S. to Canada to try to resettle there.

As their case gained attention, Trump intervened by asking National Security Council officials to find a way for them to travel, officials said. Ultimately the State Department, which adjudicates visa applications, asked the Homeland Security Department to let them in on “parole,” a temporary status used only in exceptional circumstances to let in someone who is otherwise ineligible to enter the country. The U.S. granted parole after determining that it constituted a “significant public benefit.”