British teenager Shamima Begum, who left her home country in 2015 to join the Islamic State terrorist group in Syria, can return to Britain to challenge the government’s decision to revoke her citizenship, the Court of Appeal ruled on Thursday, Reuters reported. Begum, who has been referred to as the “ISIS bride”, was stripped of her British citizenship last year on security grounds.

Begum had married Yago Riedijk, a Dutchman and an Islamic State member who surrendered to Syrian fighters. A British journalist who came across a pregnant Begum living in a refugee centre in northeastern Syria last year was told that she wanted to return home. Her infant son had died in the camp about three weeks after he was born. Britain stripped her of citizenship as its domestic intelligence agency considered her a security threat.

But three judges from England’s Court of Appeal on Thursday unanimously agreed Begum could have a fair and effective appeal of that decision . “Fairness and justice must, on the facts of this case, outweigh the national security concerns,” judge Julian Flaux wrote in a ruling. “I consider that Ms Begum’s claim for judicial review of the decision of Special Immigration Appeals Commission... succeeds.”

In February, the Special Immigration Appeals Commission had ruled that the decision to remove Begum’s citizenship was lawful because she was “a citizen of Bangladesh by descent”, according to BBC. Begum is understood to have a claim to Bangladeshi nationality through her mother, but had told the news network she does not have a Bangladeshi passport and has never been to the country.

The Court of Appeal said on Thursday that national security concerns about her “could be addressed and managed if she returns to the United Kingdom”.

Daniel Furner, Begum’s solicitor, said she has never had a fair opportunity to give her side of the story. “She is not afraid of facing British justice, she welcomes it,” Furner told the BBC. “But the stripping of her citizenship without a chance to clear her name is not justice, it is the opposite.”

However, Britain’s Home Office said the decision was “very disappointing” and it would apply for permission to appeal. “The government’s top priority remains maintaining our national security and keeping the public safe,” an interior ministry spokesperson said in a statement.

Begum’s legal team had challenged the ruling on three grounds – that it was unlawful because it left her stateless, it exposed her to a real risk of death or inhuman and degrading treatment, and because she could not effectively challenge the decision while she was barred from returning to the UK. Under international law, it is only legal to revoke someone’s citizenship if an individual is entitled to citizenship of another country.