Madonna has been given permission to adopt Mercy James from Malawi.
The country's highest court today allowed the pop star to adopt the three-year-old girl after a lower court refused her initial request back in April.
The Supreme Court of Appeal said it had failed to take into account modern realities when it rejected her application.
Madonna appealed after the lower court ruled she could not adopt the girl because the singer had not spent enough time in Malawi.
The lower court also said residency rules had been bent when Madonna adopted her son David, three, from Malawi last year.
Chief Justice Lovemore Munlo said today that was a narrow interpretation based on old laws, and that it is possible in today's globalized world to be resident in more than one place at a time.
He added that Madonna's commitment to the welfare of disadvantaged children should have been also been considered.
The 50-year-old star founded a charity called Raising Malawi that helps feed, educate and provide medical care for the country's one million orphans, the majority of whom have lost parents to AIDS.
Her decision to adopt from the African country promoted concerns from children's welfare groups who said rules had been bent because of Madonna's celebrity status and possibly out of gratitude to what she had done for Malawi