A 13 year old boy fled Taliban attempts to train him up as a suicide bomber to seek refuge in Brighton.

After the boy's father, a Taliban fighter, was killed by British forces he escaped from Afghanistan for Europe, fearing he could be executed, murdered or tortured if he stayed in the country.

But successive immigration judges refused his pleas for asylum and ignored psychological reports that found he had learning difficulties and would be unable to give evidence in a court.

The youngster was forced to give evidence despite expert advice saying he would be incapable of answer questions and accurately answer - then judges dismissed his application on the grounds that his account was inconsistent and he could not remember details like how often he charged his mobile phone.

The boy's case, brought by Brighton Housing Trust, has now led to a landmark legal ruling forcing immigration judges to consider young asylum seekers to be vulnerable children first and refugees second. The boy will now be given another opportunity to appeal.

The country's highest immigration judge, Senior president of tribunals Sir Ernest Ryder said: "His father was a member of the Taliban. He was not normally allowed outside the compound in which he lived. His family were provided for by the Taliban. When he was about 13 his father was killed by British forces. A few days later he was assaulted by the Afghan police and he was hospitalised. After returning home, Taliban men came and took him away to a training camp with the intention of training him to be a suicide bomber. Eight to ten days later he managed to escape. His maternal uncle handed him over to agents who facilitated his removal from Afghanistan and his journey into Europe.

"He says that he has a well founded fear of persecution in Afghanistan both from the Afghan police who consider him to be a member of a Taliban family and from the Taliban who will either want to punish him or use him as a fighter. It is said that he has mental health and psychological difficulties."

The Secretary of State refused his asylum claim but granted the boy, who is now 15 year old boy discretionary leave to remain in the UK until he is 17 and a half.

Sir Ernest said that the judge who oversaw the boy's appeal at the First Tier Immigration Tribunal, made a "surprising and unsatisfactory" decision in making his ruling before considering the boy's psychological assessment.

The boy then appealed again to an Upper Tier Tribunal but again Sir Ernest said they made "an error in law" adding that "the proceedings were neither fair nor just" because they had not made sure the boy's voice could be heard in the proceedings.

He said that the tribunal judges "did not properly consider the impact of the appellant's age, vulnerability and the evidence of a significant learning disability" and failed to take into account evidence of the risk to the boy if he returned to Afghanistan.

Sir Ernest advised tribunal judges as part of his ruling that "relevant immigration, asylum and nationality functions" could be to be discharged in favour of protecting children. He added: "A decision taken without regard to the need to safeguard and promote the welfare of any children involved will not be 'in accordance with the law'."