Shamima Begum should be allowed back into the UK to fight the government's decision to remove her citizenship, the Court of Appeal has ruled.
Ms Begum, now 20, was one of three schoolgirls who left London to join the Islamic State group in Syria in 2015.
Her citizenship was revoked by the Home Office on security grounds after she was found in a refugee camp in 2019.
The Court of Appeal said she had been denied a fair hearing because she could not make her case from the camp.
The Home Office said the decision was "very disappointing" and it would "apply for permission to appeal".
The judgement means the government must now find a way to allow the 20-year-old to appear in court in London despite repeatedly saying it would not assist removing her from Syria.
Daniel Furner, Ms Begum's solicitor, said: "Ms Begum has never had a fair opportunity to give her side of the story. She 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."
Ms Begum had argued that the government's decision to revoke her citizenship was unlawful because it left her stateless.
Under international law, it is only legal to revoke someone's citizenship if an individual is entitled to citizenship of another country.
At a hearing at the Court of Appeal last month, her lawyer also argued that Ms Begum, who remains in the camp in northern Syria, could not effectively challenge the decision while she was barred from returning to the UK.
In February, a tribunal ruled that the decision to remove Ms Begum's citizenship was lawful because she was "a citizen of Bangladesh by descent" at the time.
Ms Begum is understood to have a claim to Bangladeshi nationality through her mother.