Shamima Begum should be allowed to return to the UK to challenge the deprivation of her British citizenship, senior judges have ruled.
Ms Begum - one of three east London schoolgirls who travelled to Syria to join the so-called Islamic State group (IS) - travelled to Syria in February 2015 and lived under IS rule for more than three years before she was found, nine months pregnant, in a Syrian refugee camp in February last year.
Then home secretary Sajid Javid revoked her British citizenship on national security grounds later that month.
Ms Begum, now 20, took legal action against the Home Office, claiming the decision was unlawful because it rendered her stateless and exposed her to a real risk of death or inhuman and degrading treatment.
This morning Lord Justice Flaux, Lady Justice King and Lord Justice Singh ruled that Ms Begum should be allowed to return to the UK to pursue her appeal, albeit subject to controls imposed by the Secretary of State.
Handing down their ruling the judges concluded: "We accept that, in her current circumstances, [Ms Begum] cannot play any meaningful part in her appeal, and that, to that extent, the appeal will not be fair and effective."
In February, the Special Immigration Appeals Commission (SIAC) - a specialist tribunal which hears challenges to decisions to remove someone's British citizenship on national security grounds - ruled the decision was lawful as Ms Begum was "a citizen of Bangladesh by descent" at the time of the decision.
The tribunal also found that she "cannot play any meaningful part in her appeal and that, to that extent, the appeal will not be fair and effective", but ruled that "it does not follow that her appeal succeeds".
Ms Begum's challenge to the Home Office's decision to refuse to allow her to enter the UK to effectively pursue her appeal was also rejected.
In June, Ms Begum's barrister Tom Hickman QC told the Court of Appeal that removing his client's British citizenship took away "the real possibility that she could return to the UK".
He said the decision had the result of "exposing her to ... the real risk of removal to Bangladesh or Iraq", where Ms Begum faced "extra-judicial killing at the hands of the police" or "a wholly unfair and predetermined 'trial' and an immediate sentence of death".
"This led to her being held in conditions akin to detention in a foreign state at the hands of a third party, the Syrian Defence Force.
"It was not the result of any action by the secretary of state and the deprivation decision did not have any causative impact on the appellant in this respect."
Ms Begum was one of three schoolgirls from Bethnal Green Academy who left their homes and families to join IS, shortly after Sharmeena Begum - who is no relation - travelled to Syria in December 2014.
Kadiza Sultana and Amira Abase, then 16 and 15 respectively, and Ms Begum boarded a flight from Gatwick Airport to Istanbul, Turkey, on February 17 2015, before making their way to Raqqa in Syria.
Ms Begum claims she married Dutch convert Yago Riedijk 10 days after arriving in IS territory, with all three of her school friends also reportedly marrying foreign IS fighters.
She told The Times last February that she left Raqqa in January 2017 with her husband but her children, a one-year-old girl and a three-month-old boy, had both since died.
Her third child died shortly after he was born.
Shamima Begum's solicitor Daniel Furner, from Birnberg Peirce, said in a statement after the ruling: "The court's judgment today is an important reminder that fairness and the rule of law remain cornerstones of the British legal system and that they set the legal limits within which the Home Secretary may act.
"Justice cannot be defeated, or indefinitely delayed, because a case is difficult or because national security is engaged.
"Fundamental rights are not extinguished because a person is abroad, or because the allegations against them are serious.
"As important as the reiteration of those centuries-old principles was the court's unqualified rejection of the Home Secretary's argument that the impediments to Ms Begum's participation in her appeal were of her own making.
"As the court said, approaching the case on that basis risks putting the cart before the horse.
"Ms Begum has never had a fair opportunity to give her side of the story. The court itself noted the 'obvious' difference between interviews given to journalists, and instructions provided to a solicitor in court proceedings.
"Ms Begum is not afraid of facing British justice, she welcomes it. But the stripping of her citizenship without a chance to clear her name is not justice - it is the opposite."
At the hearing last month, Mr Hickman argued that Ms Begum's appeal against the deprivation of her citizenship should be allowed because it "cannot be pursued in a manner that satisfies even minimum requirements of fair procedure".
He also said Mr Javid had been informed that Ms Begum could not have a fair or effective appeal when he took the decision to revoke her citizenship.
Mr Hickman pointed out that Ms Begum, who remains in the al-Roj camp in Syria, was only 15 when she left the UK, saying: "She had not even taken her GCSE exams."
Sir James Eadie QC, representing the Home Office, said: "The fact that the appellant could not fully engage with the statutory appeal procedure was a result of her decision to leave the UK, travel to Syria against Foreign and Commonwealth Office advice and align with ISIL.