A ground-breaking ruling by the new Special Immigration Appeals Commission could have major implications for around two million Muslims living in the UK.
The commission's role is to handle appeals against expulsions ordered on grounds of national security.
In its decision in the case of Shafiqur Rehman v The Secretary of State for the Home Department, the commission, headed by Mr Justice Potts, overruled a decision by Home Secretary Jack Straw. Straw had refused a Pakistani cleric, 28-year-old Shafiqur Rehman, permission to stay in the UK indefinitely and ordered his deportation on the grounds that he was a threat to national security.
The basis of the Home Secretary's decision was that he was satisfied that Rehman was the UK head of an Islamic extremist group linked to Kashmiri guerrillas.
The decision followed claims from MI5 that he had raised funds for terrorism and had recruited British muslims for training for a "holy war".
However, lawyers for Rehman claimed that MI5 took the stance it did after Rehman rejected moves by the agency to recruit him.
The commission accepted that Rehman had helped provide sponsorship and information for people going to Pakistan for training, which could have included militant or extremist activities.
However, it held that the Government had not proved that Rehman knew the nature of the training.
The commission took the view that in the eyes of the law, a person could only be deemed to have gone against national security if they had engaged in, promoted or encouraged violent activity targeted at the UK, its Government or its people.
Rehman, it said, had not done this and in those circumstances his appeal should be allowed.
Solicitor Amjad Malik, of small Manchester firm Bhatti solicitors, who represented Rehman on a pro bono basis after legal aid was refused, described the decision as a "landmark ruling".
He says: "It is a decision which has clarified the meaning of the term national security and which will directly affect two million Muslims living in Britain and the rights of other Muslim clerics coming to this country to later seek leave to stay indefinitely."
The case was one which was fraught with problems for Malik and counsel Sibghat Kadri QC and Nicholas Blake.
They had wanted to call a considerable amount of expert evidence, but were precluded from doing so by refusal of legal aid both at High Court and Appeal Court levels.
Malik says: "He should have been granted legal aid. We had been told to go to the Immigration Advisory Service for assistance, but they are used to dealing with relatively simple matters, not matters of this sort of complexity.
"The case involved a very complex and mute area of law, which had not been tested before. It called for a definition of both national security and terrorism and involved consideration of not only domestic law but also several articles of the European Convention on Human Rights and international law.
"My own view is that now we have this decision, the best possible way forward in this multicultural and multireligious society is to let it stand.
"However, we have been told that the Home Secretary is likely to appeal.
"If there is an appeal then we will contest it very strongly.
"We don't know how many other people are in a similar situation to Mr Rehman. We think there could be quite a lot.
"All the priests who come from abroad come under a five-year visa and after that they apply for indefinite leave.
"If the Home Secretary's decision had been upheld, it would have meant that many Muslim clerics would have been under a direct threat if they had talked about jihad [holy war] and Kashmir.
"The case has basically protected the Muslims' human rights of the freedom of expression and the freedom to practice their religion."