Donald Trump has been praised for allowing an all-girl robotics team from Afghanistan to enter the US, despite his travel ban making it difficult for them to receive visas.

The six-girl team and their chaperone from Herat, Afghanistan, had two visa applications refused before a last-minute intervention by the US President allowed them to travel.

Mr Trump’s personal intervention in the girls’ case using a rare “parole” mechanism to sidestep the visa system ended a dramatic saga in which the team twice travelled from their home in western Afghanistan through largely Taliban-controlled territory to Kabul, only for their applications to be denied on both occasions.

The team will enter their ball-sorting robot in a three-day international robotics competition in Washington DC that starts on Sunday.

Afghan Ambassador Hamdullah Mohib said: “Seventeen years ago, this would not have been possible at all.

“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.”

Mr Trump’s counsel Kellyanne Conway also praised the decision, saying: “Thank you, @POTUS, for helping these girls. Others talk (and talk and talk). You act.”

Donald Trump's international Presidential trips Show all 22 1 /22 Donald Trump's international Presidential trips Donald Trump's international Presidential trips French President Emmanuel Macron and US President Donald Trump AFP/Getty Images Donald Trump's international Presidential trips French President Emmanuel Macron and US President Donald Trump talk as they leave the Army Museum at Les Invalides in Paris AFP/Getty Images Donald Trump's international Presidential trips German Chancellor Angela Merkel and US President Donald Trump arrive for the group photo at the G7 Taormina summit on the island of Sicily in May 2017 Getty Images Donald Trump's international Presidential trips Mr Trump was pressed on the subject at the G7 summit in Italy Getty Donald Trump's international Presidential trips US President Donald Trump gives a speeech at the Warsaw Uprising Monument on Krasinski Square Getty Donald Trump's international Presidential trips US President Donald Trump and Britain's Prime Minister Theresa May during a ceremony at the NATO headquarters before the start of a summit in Brussels, Belgium Reuters Donald Trump's international Presidential trips Montenegro's Prime Minister Dusko Markovic is seen to the right of Donald Trump at a Nato summit in Brussels REUTERS Donald Trump's international Presidential trips Pope Francis meeting with US President Donald J. Trump EPA Donald Trump's international Presidential trips Pope Francis poses with US President Donald Trump and First Lady Melania Trump AFP/Getty Images Donald Trump's international Presidential trips US President Donald Trump arrives at Palazzo del Quirinale ahead of the meeting with Italian President Sergio Mattarella Ufficio Stampa Presidenza della via Getty Donald Trump's international Presidential trips US President Donald Trump is seen during a joint press conference with the Palestinian leader at the presidential palace in the West Bank city of Bethlehem AFP/Getty Images Donald Trump's international Presidential trips Palestinian president Mahmoud Abbas meets US President Donald Trump PPO via Getty Donald Trump's international Presidential trips Israeli Prime Minister Benjamin Netanyahu speaks with US President Donald Trump prior to the President's departure GPO via Getty Images Donald Trump's international Presidential trips US President Donald Trump and Israel's Prime Minister Benjamin Netanyahu shake hands after delivering a speech at the Israel Museum AFP/Getty Images Donald Trump's international Presidential trips US President Donald Trump and First Lady Melania Trump lay a wreath in the Hall of Remembrance as White House senior advisor Jared Kushner and Ivanka Trump watch on during a visit to the Yad Vashem Holocaust Memorial museum AFP/Getty Images Donald Trump's international Presidential trips US President Donald Trump visit to Yad Vashem Holocaust museum in Jerusalem accompanied by Prime Minister Benjamin Netanyahu GPO via Getty Images Donald Trump's international Presidential trips US President Donald Trump takes his seat before his speech to the Arab Islamic American Summit in Riyadh in Saudi Arabia Reuters Donald Trump's international Presidential trips Saudi Arabia's King Salman bin Abdulaziz al-Saud, US President Donald Trump and US First Lady Melania Trump look at a display of Saudi modern art at the Saudi Royal Court in Riyadh AFP/Getty Images Donald Trump's international Presidential trips US President Donald Trump and Saudi Arabia's King Salman bin Abdulaziz al-Saud take part in a signing ceremony at the Saudi Royal Court in Riyadh AFP/Getty Images Donald Trump's international Presidential trips King Salman presents Donald Trump with The Collar of Abdulaziz al-Saud Medal at the Royal Court Palace on 20 May AP Donald Trump's international Presidential trips US President Donald Trump is welcomed by Saudi King Salman bin Abdulaziz al-Saud upon arrival at King Khalid International Airport in Riyadh AFP/Getty Images Donald Trump's international Presidential trips U.S. President Donald Trump and first lady Melania Trump walk on the South Lawn prior to their first foreign trip Getty Images

But others accused the White House of having the “audacity” to take credit for helping the girls despite their visas being rejected twice before by US officials.

Pollster Matt McDermott wrote on Twitter: “The audacity: White House wants credit for intervening to help girls that had difficulty entering country because of Trump's own Muslim Ban!”

Another user said: “Trump is like the boy in court for murdering his parents who asks the judge for mercy because he's an orphan.”

Afghanistan isn’t included in Mr 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 US.

The US would not confirm why the girls were rejected for visas, citing confidentiality.

But Mr Mohib said that based on discussions with US officials, it appears the girls were rebuffed due to concerns they would not return to Afghanistan.