Madonna previously adopted Malawian boy David Banda
Madonna has said she is "ecstatic" after her bid to adopt a second child was approved by a Malawian court.
The 50-year-old had appealed after a lower court rejected her original application to adopt Chifundo "Mercy" James, four, over residency issues.
But the appeals court said the star's commitment to helping disadvantaged children had not been considered.
"My family and I look forward to sharing our lives with her," Madonna said in a statement.
She said she was "extremely grateful" to the court for its ruling.
Madonna's lawyer Alan Chinula said he was arranging a passport for Mercy and was waiting to hear from Madonna about travel plans for the child.
Mercy's uncle Peter Baneti said the family welcomed the ruling.
"We hope Mercy will be joining Madonna soon," he said.
The southern African state's chief justice, Lovemore Munlo, praised Madonna's interest in helping Malawian orphans and said the child would have a better life with the star.
Madonna's lawyer on adoption verdict
The singer has founded a charity, Raising Malawi, which helps feed, educate and provide medical care for some of Malawi's one million-plus orphans.
"In our view, Chifundo James is better taken care of by being adopted by foreign parents who will give her love and affection," he said during the appeal hearing.
She was also financially stable, he added.
"In this global village, a man can have more than one place at which he resides.
"The matter of residence should be determined at the time of application of the adoption.
"In this case, Madonna was in Malawi not by chance but by intention."
Madonna's commitment to Malawian orphans meant she could "not be described as a sojourner", he added.
Judge Esmie Chondo ruled out the adoption in April, saying prospective parents had to be resident in Malawi for 18 months.
Those rules were waived in 2006 when Madonna adopted a boy, David, from the southern African state.
Child welfare groups had argued that the residency rule was central to adoptions, and that Malawian parents should be sought before children were placed overseas.
The appeals court said the earlier decision had been based on a narrow interpretation of old laws.
But the appeal ruling has been criticised by Malawi's Human Rights Consultative Committee - a coalition of non-governmental organisations.
HAVE YOUR SAY
The Material Girl has got her own way again, proof that money really is power
Craig Ruff, Manchester
Undule Mwakasungula said the judge had "disregarded" international agreements on children's rights and adoptions.
"We are a bit surprised but we can't challenge it because the supreme court has ruled and we have to go with that," he said.
Mercy has been living in an orphanage since her teenage mother died shortly after giving birth.
Madonna also has two biological children - Lourdes, 12, and Rocco, aged eight.
Last month, the man believed to be Mercy's father, told US TV programme The Early Show he opposed the adoption and wanted to look after her - even though he had never met her.
After the appeal court's decision, he told CBS News: "I'm crying. I need my baby. I don't know where I can find any help."