Madonna had previously been assured that the adoption of four year old Mercy James was pretty much a sure thing and Friday's hearing would be a paper-signing formality - but Judge Esme Chombo surprised the star and her lawyers by refusing the request, citing the requirement that adoptive parents must reside in the African country for between 18 and 24 months.
Children's & human rights groups in the country are said to be delighted by the decision after Madonna was said to have bypassed that requirement when she adopted her first child from the country, son David, in 2006 - but Madonna's lawyer Alan Chinula said they were "very surprised" by decision.
The star was not in court for the hearing and an onlooker at the luxury lodge where she has been staying told reporters that she "furiously stormed off" when told the news of the denial: "She was unrecognisably angry - she seemed in emotional agony.
"We couldn't tell if she was crying, but her daughter Lourdes ran and put her arms round her. Madonna said to her lawyer, 'This is the worst day of my life'.
"She yelled at him, 'What went wrong? How could this happen'? He was staring at the ground."
Madonna left the country by private jet yesterday with her children Lourdes, Rocco and David. The family had arrived in Malawi last Sunday and spent the week visiting improverished villages around the capital Lilongwe, meeting David's biological dad Yohane Banda and meeting with the girl they hoped would be the new addition to their household.
Madonna's ex-husband Guy Ritchie said he too was "saddened" by the news that the adoption had been turned down. Guy was initially said to be opposed to the couple's joint adoption of David but quickly grew to love the boy.
He issued a statement yesterday saying: "Madonna is a fantastic and loving mother who cares deeply about her own children, and children who may need additional help and support.
"I fully supported her decision to apply for this adoption and I am saddened her application was rejected.
"Madonna is motivated only by being a caring parent who seeks to share some of the advantages life has given her. There will be other opportunities and I wish her well in them."
Madonna is expected to stay in London for the next week to celebrate the Jewish holiday of Passover with her friends at the Kabbalah Centre in London. Guy is said to be taking the week off work to spend time with sons Rocco and David at his Wiltshire home while Lourdes will spend time with her mum in London as well as seeing her former step-dad.--