The Court of Appeal has found that legislation which prevented an Irish citizen child, living in direct provision, from getting child benefit payments until her mother got residency here are unconstitutional.

The court found sections of the 2005 Social Welfare Act to be unconstitutional but suspended making the formal declaration of unconstitutionality until 1 February next year.

The case involves a three-year-old girl who lives in direct provision with her mother who is from Nigeria. Her father is a naturalised Irish citizen but the couple's relationship broke down after the girl's birth.

In October 2015, the mother sought child benefit but she was refused until she was given residency status in January 2016. The mother had said her daughter had a hereditary blood disease and they were living in difficult circumstances with a weekly allowance of €43.

In the appeal court's judgment, Mr Justice Gerard Hogan said child benefit was "designed for the benefit of the child" even if it was paid to the qualifying parent. He said the failure to treat this child equally to other Irish citizen children was unconstitutional.

He directed that the backdated benefit covering the period between October 2015 and January 2016 should be paid.

In a separate but related case, involving an Afghan couple and their four children, the court found the family's youngest child was not entitled to child benefit for the period before the couple were granted residency in September 2015.

The five-year-old child was granted refugee status in January 2015.

The judge found in that case, that the State could not generally be expected to make social security payments to people with no right to reside here.

He said the key difference between the two cases was "citizenship".