Madonna says she's "ecstatic" with the ruling from Malawi's highest court that she can adopt 3-year-old Chifundo "Mercy" James.
Malawi's Supreme Court overruled a lower court decision to stop Madonna from adopting the girl.
"My family and I look forward to sharing our lives with her," Madonna said in a statement Friday.
The lower court had ruled that the star, who adopted a son from Malawi last year, had not spent enough time in the country.
But Chief Justice Lovemore Munlo, reading from the three-judge decision on Friday, said the lower court made a narrow interpretation based on old laws.
"In this global village a man can have more than one place at which he resides," Munlo said.
The decision also said that Madonna's commitment to helping poor children should have been considered by the lower court.
Madonna founded the Raising Malawi charity which helps feed, educate and provide medical care for orphans in the country.
Malawi has more than 1 million orphans, half of whom have lost a parent to AIDS.
Malcolm Mumba, a Malawian children's rights advocate with Plan International, said there is no proper mechanism in place to follow up and ensure that children adopted to other countries are properly cared for.
Although the high court's decision is final, Mumba told Â鶹ӰÊÓ Channel that his organization will continue to pressure the government to "ensure safeguards in the law for a child that is adopted."
James Kambewa, claiming to be the girl's father, said he was "crying" after hearing the decision.
I need my baby. I don't know where I can find any help," Kambewa told CBS news.
The girl's 18-year-old mother, who was unmarried, died shortly after giving birth.
The girl's maternal relatives agree to the adoption but Kambewa says he wants to take care of his daughter.
With files from The Associated Press