The Afghan girls' robotic team will be allowed to travel to the United States to participate in an international robotics competition after their visa applications were denied twice. (Taylor Turner/The Washington Post)

A group of Afghan teenage girls will be allowed to travel to the United States to partake in an international robotics competition after their visa applications were denied twice, U.S. officials said Wednesday.

A Homeland Security Department spokesman said in an email that the agency had approved a request from the State Department for the six girls on the robotics team and their chaperon to enter the country and attend the competition, which is set to bring teams from more than 160 countries to Washington next week.

The decision resolves a dispute that drew backlash from human rights activists and raised questions about whether U.S. agencies were retreating from previous efforts to advocate for young women in Afghanistan, where they are often denied educational opportunities.

The criticisms also fueled arguments that President Trump is seeking to ban Muslims from entering the country. The most recent version of Trump’s travel ban places visa restrictions on citizens of six predominantly Muslim countries, but Afghanistan is not on the list.

The head of FIRST Global, the organization hosting the competition, cheered the news in a statement Wednesday.

“I truly believe our greatest power is the power to convene nations, to bring people together in the pursuit of a common goal and prove that our similarities greatly outweigh our differences,” said FIRST Global President Joe Sestak, a former U.S. Navy admiral and Democratic congressman. “That is why I am most grateful to the U.S. Government and its State Department for ensuring Afghanistan, as well as Gambia, would be able to join us for this international competition this year.”

It remains unclear why the State Department denied the girls’ visa applications in the first place. A spokesman for the agency told the Associated Press on Wednesday that “all visa applications are adjudicated on a case-by-case basis in accordance with U.S. law.”

In allowing the girls to travel to the United States, the Department of Homeland Security granted them “parole,” authorizing a one-time, temporary entry into the country for humanitarian reasons or “significant public benefit,” a spokesman told The Post.

Members of a robotics team from Gambia were also granted visas Wednesday after being previously being barred from entering, as the Associated Press reported. Teams from Syria, Iran and Sudan, all countries included in Trump’s travel ban, have not faced similar setbacks.

Politico, which broke the story Wednesday evening, reported that Trump had personally intervened and asked officials at the National Security Council to take action.

The president’s daughter, Ivanka Trump, tweeted her support on Wednesday, saying she looked forward to welcoming “this brilliant team of Afghan girls” to Washington next week.

The girls, all high schoolers, had constructed a ball-sorting robot to enter in the FIRST Global Challenge, an international robotics contest that aims to promote interest in science, technology, engineering and math (the acronym stands for For Inspiration and Recognition of Science and Technology). After persuading their parents to let them attend, the team made two 500-mile trips from their hometown of Herat in western Afghanistan to the U.S. Embassy in Kabul to apply for visas, as The Washington Post reported.

When they got the news that their visa applications had been denied, the girls were heartbroken. “They were crying all day,” Roya Mahboob, an Afghan software executive and one of the team’s sponsors, told The Post earlier this month.

The girls wrote on their competition page: “We want to make a difference, and most breakthroughs in science, technology and other industries normally start with the dream of a child to do something great. We want to be that child and pursue our dreams to make a difference in people’s lives.”

More from Morning Mix

Authorities discover human remains in Bucks County, Pa., where 4 men went missing

Texas teen was electrocuted by her cellphone while taking a bath, her family says