The supreme court of appeal said today the popstar was free to adopt four-year-old Mercy James, despite not having lived in Malawi for 18 to 24 months, as the law requires.

Chief Justice Lovemore Munlo said the initial decision by the high court in April to reject Madonna's adoption application had failed to take account of modern realities.

"In this global village a man can have more than one place at which he resides," Munlo said in the ruling.

He said Madonna's commitment to disadvantaged children – she funds the Raising Malawi charity serving 25,000 orphaned children – should have been taken into account.

The American singer adopted a 13-month-old boy, David Banda, in Malawi in 2006. Local critics then accused her of using her fame to sidestep regulations after she was given permission to take the child to London before the adoption was finalised in 2008.

Madonna spotted Mercy at an orphanage three years ago, but waited until earlier this year to begin formal adoption proceedings.

In a surprise decision, the high court ruled in April that bending the rules again would set a dangerous precedent. No other foreigners had been allowed to adopt any of Malawi's estimated 1 million orphans without satisfying the residency requirements, the judge said.

Madonna, who was staying at a safari lodge in the country at the time, launched an immediate appeal. During a hearing in May, a constitutional expert acting for Madonna told three appeal court judges that rejecting the application would be a breach of the child's rights.

A local group opposing the adoption, Eye of the Child, said the residency rules were necessary to avoid child abuse, and foreign adoptions should be a last resort.

There have been reports that some relatives of Mercy, whose 18-year-old mother died soon after giving birth and whose father is unknown, are uncomfortable with Madonna's plan.

But it is clear the government is in favour of the adoption. After the high court ruling, President Bingu wa Mutharika said Mercy was being offered a chance to have a good education and a better future.

Judge Munlo agreed. He said the appeal court saw two options for Mercy "either to stay at the orphanage without the love of family and live with the possibility of destitution or be with Madonna where she is assured of love. Every child has the right to love."