A group of Afghan girls will travel to the United States after being denied entry into the U.S. to attend a robotics competition.

The girls' applications for U.S. visas had been denied twice, but the White House says President Donald Trump intervened and they will be allowed in to participate in the competition.

White House spokeswoman Sarah Huckabee Sanders confirmed details of the reversal Wednesday, ending a saga that had sparked international backlash.

TRAVEL BAN: WHO DOES TRUMP'S EXECUTIVE ORDER BLOCK FROM ENTERING US?

The decision by the U.S. Citizenship and Immigration Services means the six teenage girls from the war-torn country will be allowed in, along with their chaperone, so they can participate in the competition.

Previously, the State Department declined to comment on why their visas were denied, saying “all visa applications are adjudicated on a case-by-case basis in accordance with U.S. law.”

Afghanistan is not part of the Trump administration’s executive order temporarily banning travel from six Muslim-majority countries. Teams from Syria, Iran and Sudan – countries that are part of the order – were granted visas.

US HITS 50,000 REFUGEE LIMIT, BUT SOME WILL STILL TRICKLE IN

Following the change, the State Department said it worked with the Department of Homeland Security to remedy the situation.

“The State Department worked incredibly well with the Department of Homeland Security to ensure that this case was reviewed and handled appropriately,” Dina Powell, White House deputy national security adviser for strategy, said in a statement, according to Politico. “We could not be prouder of this delegation of young women who are also scientists -- they represent the best of the Afghan people and embody the promise that their aspirations can be fulfilled. They are future leaders of Afghanistan and strong ambassadors for their country.”

After news broke that the group of girls will be able to attend the competition, Ivanka Trump tweeted that she was "thrilled" to welcome the competitors to the District next week.

The international robotics competition is an “Olympics”-style compeititon in which one team from every nation is invited to participate. It takes place from July 1 to 18 in Washington, D.C.

The Associated Press contributed to this report.