Kim Kardashian, a UK football club and a US rabbi all helped them.
Now members of Afghanistan's female youth development football team have safely landed in Britain where they will begin a new life.
A plane carrying more than 30 teenage players and their families, about 130 people in all, landed at Stansted Airport near London on Thursday.
Britain and other countries evacuated thousands of Afghans in a rushed airlift as Kabul fell to Taliban militants in August.
But the women's youth development football team missed out. Instead, they took refuge in neighbouring Pakistan.
However, their visas only lasted 30 days.
According to the British news agency PA, they were evacuated to the UK on a flight funded by reality TV star Kim Kardashian.
Among other things, the young footballers received support from Leeds United football club, whose owner, Andrea Radrizzani, said in a statement he was "delighted" with the arrival in the UK.
“It demonstrates the power of football, and sport in general, as a force for good and how much the football community is able to work together and mobilize to save lives,” he added.
Leeds United had offered to welcome the players into the junior teams to give these girls a "prosperous future".
Women playing sport was seen as a political act of defiance against the Taliban, and hundreds of female athletes have left Afghanistan since the group returned to power and began curbing women's education and freedoms.