Madonna and her adopted twin daughters have accepted undisclosed damages from Associated Newspapers over a "serious invasion of privacy".
The singer adopted four-year-old twins Stella and Estere in February.
At the time she asked the media to "respect our privacy during this transitional time."
Madonna brought the case at London's High Court over a MailOnline article that caused her "considerable personal distress", her solicitor said.
The article - which appeared in January, before Madonna had formally adopted the twins - revealed the girls' names, race and age.
It also disclosed the fact they lived in an orphanage in Malawi and were the subject of pending applications for adoption by the singer.
"The MailOnline published it at a time when, as the journalist ought to have appreciated, Madonna would be powerless to protect the girls from harm," solicitor Jenny Afia told Mrs Justice Nicola Davies on Thursday.
"Their actions could, in her view, have threatened the integrity and/or outcome of the adoption process which would have had potentially life-changing implications for the girls, as well as for Madonna and her family."
"Many people in Malawi know of Madonna as an individual of fame and financial means," she went on.
"In the circumstances, Madonna believes that it would (and should) have been self-evident to the reporter that the protection of the girls' identities pending the decision about their potential adoption was likely to be vital for their safety and welfare."
After the hearing, Ms Afia said: "Madonna brought this litigation because the newspaper threatened her girls' safety by naming them before they were adopted.
"She will always take all possible steps to protect her family's well-being."
Ms Afia added that Madonna would donate the damages to The Mercy James Institute for Paediatric Surgery.
The children's hospital in Malawi opened earlier this month and is named after one of the singer's other adopted daughters.
"She is pleased that at least some good can come out of the situation," Ms Afia said.