The Home Office has been ordered to arrange for a deported migrant family to be returned to Britain from Nigeria – in a landmark ruling that threatens to undermine the Government’s “deport first, appeal later” policy.

Theresa May’s department will face contempt of court proceedings unless the woman and her five-year-old son are located and transported back to the UK at the Home Office’s expense by Thursday 23 April. It is believed to be the first time that an immigration judge has demanded that the Government retrieve asylum-seekers previously deported from the UK.

Asylum campaigners and children’s charities have welcomed the ruling, which could have major implications for the way in which scores of children and their parents are deported from the UK every year.

The judgment raises fresh doubts about the validity of Ms May’s election pledge to implement a “deport first, appeal later” regime under which asylum-seekers and migrants would automatically be sent back to their country of origin unless they could prove they would be at risk of “irreversible harm”.

Last week’s ruling, which can now be disclosed by The Independent, sets a potential precedent that the best interests and the welfare of the child should be the “primary consideration” in deportation orders even if their parents’ case has been quashed.

Mr Justice Cranston, sitting in the Upper Tribunal of the Immigration and Asylum Chamber, granted a judicial review of the decision to deport the pair and in a highly unusual move – believed to be the first of its kind – ordered that the Home Office organise and foot the bill for their return to the UK by Thursday at the latest.

The Home Office has now been granted a last-minute hearing at the Court of Appeal to quash that decision, reflecting the seriousness of the case.

The ruling criticised the Home Office for its “flawed” decision to put the child, referred to as RA, and his 45-year-old mother BF on a plane to Nigeria at the end of January despite evidence of the woman’s poor mental health and the risk that both she and her son would end up destitute on the streets and at risk of prostitution, child labour or trafficking.

Home Office headquarters in Westminster (Steve Cadman/Creative Commons)

The woman claims to have been in the UK illegally since 1991 and applied for asylum in 2010, stating that she feared destitution and discrimination as a single mother in Nigeria with no immediate family.

But her asylum claim was repeatedly rejected. At one point she was admitted to a psychiatric unit with depression and her son put into foster care as she battled against attempts to send them both back to Nigeria. The foster carers who looked after the boy and remained close to his mother have been paying for her accommodation and healthcare in Nigeria from their own savings because they were so concerned about what would happen to the pair.

The judge ruled: “In not taking into account the implications of BF’s mental health for RA, and the risk of that degenerating in the Nigerian context and the likely consequences of removal, the Secretary of State failed to have regard to BA’s best interests as a primary consideration.”

Ian Mearns, the Labour parliamentary candidate for Gateshead who has been a vocal supporter of the boy’s case, said: “This is a massive vindication of the local campaign on behalf of [RA]. I have been extremely concerned that the Home Office has failed to take into consideration the rights of the child in this case and in others like it.”

Judith Dennis, policy manager for the Refugee Council, said: “This case is important because it highlights the need for a clear, transparent policy [concerning] children and their rights when it comes to asylum.

“We have this rhetoric about deportation and people being able to appeal from outside the country, but what this ruling says is that you need to balance the need for immigration control against the best interests of the child.

“I don’t think the Home Office even has a proper mechanism for doing that at the moment and that’s what we need – a clear transparent policy that can be worked to when it comes to children.”

Debora Singer, policy and research manager at Asylum Aid, said: “We are very concerned that the Home Office regularly fails to give sufficient importance to the rights of women and children seeking protection in the UK. Our experience is that women fleeing domestic violence or forced marriage are often disbelieved. As a woman you are more likely than a man to have a refusal for protection corrected at appeal.

“Under international law, the Refugee Convention should be interpreted in a gender-sensitive manner and the courts are obliged to take into account the best interests of children. But neither of these obligations are a regular feature of the UK’s asylum system.”

A spokesman for the Home Office said: “We are unable to comment due to the ongoing nature of this case.”

Death and trafficking: Case background

The woman in this case says she came to the UK from Nigeria in 1991 after her parents were killed in a car crash and her aunt and uncle tried to force her into marriage with an older man.

She paid traffickers to get her to the UK, where she worked illegally in a shop before becoming pregnant and having her son in 2009.

In 2010, she claimed asylum on the basis she feared persecution if she returned to Nigeria.

Her claim was refused but the appeals process dragged on until January this year when she and her son were deported. A key part of the ruling is that his best interests have not been taken into account.

Profile: Mr Justice Cranston

Mr Justice Cranston is a former Labour MP, a friend of Tony Blair and ex-Solicitor-General who has made a series of high-profile human rights rulings in recent years.

Ross Cranston, MP for Dudley North, with Cherie Blair at a Downing Street event with young constituents in 2002 (PA)

The 66-year-old was born Ross Cranston in Australia and educated at Queensland University, Harvard and Oxford before becoming a barrister. Mr Blair recommended him for the seat of Dudley North in 1997 and appointed him Solicitor-General until 2001.

Mr Cranston left Parliament in 2005, and in 2007 became a High Court judge.