Shamima Begum, the British teenager who left London with two schoolfriends in 2015 to join ISIS in Syria, should be allowed to return to the U.K. to challenge the deprivation of her British citizenship, judges ruled Thursday.

Begum, now 20, had her British citizenship stripped by then-Home Secretary Sajid Javid on February 19, 2019, after she was found in a northern Syrian refugee camp.

She challenged that decision but on June 13, 2019, the government refused her application for leave to enter the U.K. to pursue her appeal.

The Court of Appeal and a Divisional Court of the High Court on Thursday ruled Begum should be allowed to return to the United Kingdom to pursue her appeal before the Special Immigrations Appeals Commission (SIAC) "albeit subject to such controls as the Secretary of State deems appropriate."

She is currently in a detention camp run by the Syrian Democratic Forces.

While in Syria, Begum married an ISIS fighter and had three children, all of whom have died.

SIAC found in its decision that Begum also holds Bangladeshi citizenship by descent. The court has not answered the question about whether she can be stripped of her British citizenship.

A U.K. Home Office spokesperson said the decision was "very disappointing" and it would apply for permission to appeal against the judgment.

"The government's top priority remains maintaining our national security and keeping the public safe," the spokesperson added.

Mohammed Shafiq, CEO of the Ramadhan Foundation, a U.K.-based Muslim organization that works to build cohesion between communities, said in a statement: "The decision of the Court of Appeal to allow Shamima Begum to return to the U.K. is the right decision and British citizens should welcome it.

"This is not about any alleged crimes she may have committed but about the principle you cannot have a two tier citizenship where those of a certain ethnic background born in this country are treated differently to their white counterparts," he added.

Shafiq said ISIS was an "evil entity" opposed by British Muslims and that Begum should be held to account for any alleged crimes, but lawmakers should not make decisions "to appear as if they were tough."

He called the decision a "great victory" for those who believe in equal society and oppose discrimination in applying citizenship rules.