Shamima Begum, who left the UK for Syria to join the Islamic State group as a teenager, will not be allowed to return and fight her citizenship case, the Supreme Court has ruled.
The court said in a unanimous ruling that her rights were not breached when she was refused permission to return, reports BBC.
Ms Begum, 21, wants to come back to challenge the home secretary's decision to remove her British nationality.
She is curenntly in a camp controlled by armed guards in northern Syria.
Ms Begum was 15 when she and two other east London schoolgirls left the UK in February 2015 and travelled to Syria to join the Islamic State group.
In 2019, the then-Home Secretary Sajid Javid stripped Ms Begum of her citizenship on national security grounds.
Last July, the Court of Appeal ruled that the only fair way forward was to allow her into the UK because she could not effectively appeal against the decision from the camp in northern Syria.
The Home Office subsequently appealed to the Supreme Court to reconsider the Court of Appeal's judgement, arguing that allowing her to return to the UK "would create significant national security risks".
On Friday, Lord Reed, president of the Supreme Court, said the government had been entitled to prevent Ms Begum from returning to the UK.
Announcing the ruling, Lord Reed said: "The Supreme Court unanimously allows all of the home secretary's appeals and dismisses Ms Begum's cross-appeal."
He said the Court of Appeal's judgment "did not give the home secretary's assessment the respect which it should have received" given the role's "responsibility for making such assessments" and accountability to parliament.
Lord Reed added the Court of Appeal had "mistakenly believed that, when an individual's right to have a fair hearing... came into conflict with the requirements of national security, her right to a fair hearing must prevail."
He said the right to a fair hearing did "not trump all other considerations, such as the safety of the public".
Lord Reed said the appropriate answer was not to force the government to bring Ms Begum back to the UK - but to pause her legal fight over citizenship until she is in a safer position to take part in her appeal.
He added: "That is not a perfect solution, as it is not known how long it may be before that is possible. But there is no perfect solution to a dilemma of the present kind."
The current home secretary, Priti Patel, said the Supreme Court's judgement had "reaffirmed the home secretary's authority to make vital national security decisions".
She added: "The government will always take the strongest possible action to protect our national security and our priority remains maintaining the safety and security of our citizens."
Mr Javid also welcomed the ruling, saying any "restrictions of rights and freedoms" faced by Ms Begum were a "direct" result of her "extreme" actions.
He said: "There are no simple solutions to this situation but any restrictions of rights and freedoms faced by this individual are a direct consequence of the extreme actions that she and others have taken, in violation of government guidance and common morality."