Home Secretary Theresa May must allow the family of an Islamist extremist to have UK citizenship, the High Court has said.

Mrs May had refused to grant citizenship to the extremist’s wife and adult children in order to deter others from “engaging in extremism in the future”. The Times says the unnamed Egyptian man is a failed asylum seeker who supported Osama bin Laden and Al Qaeda.

However, the court ruled that Mrs May acted unlawfully in doing so because parliament had not said citizenship could be denied purely to deter people from extremism.

Michael Fordham, QC, told the court in October the wife and children were “blameless individuals whose good character is unimpeachable” and were being wrongly punished for “the sins of the father”.

The court heard that the family had been living in Britain for 21 years, but the father had lost his claim for asylum four years after arriving. The government’s attempts to deport him failed, however, because there was a risk he would be tortured upon returning to Egypt.

However, Robin Tam QC, speaking for the Home Secretary, said that being awarded British citizenship was a “privilege, not a right” and argued that denying citizenship to the family was not too harsh a punishment because they had indefinite leave to remain anyway.

This is the latest in a series of defeats inflicted by the courts on the Home Secretary. In July, the Special Immigration Appeals Commission ruled that Mrs May could no longer keep a convicted jihadi behind bars and ordered his release into the community, despite the threat he might abscond.

The man, known in court as N2, had spent years in jail on terror-related charges and the Home Secretary had signed an order to deport him as his sentence ended. However, the judge denied the request to remand him in custody until those proceedings finished.

A Home Office spokesman said at the time: “We pursue every possible avenue to remove foreign nationals who threaten our national security and deportation with assurances is just one weapon in our wider armoury.

“Twelve individuals have been removed via these arrangements to date, including Abu Qatada in July 2013, and we are actively pursuing deportation with assurances in this case.”