An eight-month-old baby was locked up by the Home Office in immigration detention despite being a British citizen, it has emerged.

The details of the case appear in court documents revealing that the Home Office successfully won an appeal against a ruling that the baby and his mother, a Nigerian national, had been falsely imprisoned on the grounds that the burden of proof rested on the boy to prove his citizenship.

The mother, referred to in documents as TR, and her son, named as JA, were held in immigration detention for 12 days after an asylum application by TR was rejected.

The Immigration Advisory Service (IAS) wrote to the Home Office saying JA was a British citizen through his father and, to prove this, efforts were being made to update his birth certificate.

It was submitted that, as a British citizen, JA could not be removed and TR should be permitted to remain in the UK to care for him. The Home Office rejected the representations and detained mother and son.

Ultimately, the high court granted a stay of removal and TR and JA were released. A month later, JA’s British father was added to his birth certificate.

Following a trial at the central London county court, TR and JA were awarded £20,000 and £5,000 respectively for false imprisonment.

However, the Home Office appealed against this decision in the high court on the grounds that the judge made an error of law by concluding that JA could not lawfully be detained because he was a British citizen.

Mrs Justice Judith Farbey QC, in a ruling published on Thursday, ruled in favour of the Home Office as at the time of JA’s detention it was not proven that he was a British citizen and therefore there were reasonable grounds to suspect he could be removed.

She said: “If a person’s citizenship is in question, the burden lies on him to prove that he is British in order to avoid the risk of loss of liberty under the 1971 act.”

However, Farbey also allowed a cross appeal after Amanda Weston QC, representing the family, argued that if there was no power to remove JA as a British citizen and he was being breastfed there was no prospect of removing his mother.

The judge directed that the case must return to a lower court and be heard again for a fresh decision.

The child is now nine. His mother arrived in the UK on 6 October 2007 and was granted leave to enter until 9 January 2008. She overstayed her leave and remained in the UK.

JA was born in September 2009. Initially his birth certificate showed TR as his mother but the father’s details were not registered.

On 23 October 2009, TR applied for asylum and on 12 January 2010, the Home Office rejected the application and refused to grant humanitarian protection.

The IAS submitted its representations in April 2010 but the mother and son were detained on 9 May 2010 until 21 May that year.

The county court hearing was held in October 2017 and the appeal was held in October last year.