A Namibian court on Monday threw out a bid by a same-sex couple to have their twin daughters, born to a South African surrogate mother, issued documents to travel to Windhoek.
Handing down his ruling, High Court Judge Thomas Masuku said it would be "judicial overreach" for the court to order the home affairs and immigration ministry to issue emergency travel certificates to one-month-old Maya and Paula.
The twins are daughters of a Namibian-Mexican gay couple, but the Namibian authorities have dragged their feet on issuing papers for the girls.
The Namibian government has demanded proof of a biological connection between the infants and the couple, 38-year-old Phillip Luehl and his partner Guillermo Delgado, 36.
The court's rejection quashed attempts to take the infants to Windhoek to join Delgado and their two-year-old brother Yona.
"This comes as quite a surprise," Luehl, who is in Johannesburg with the girls, told AFP in a WhatsApp voice message.
He said the couple would study the ruling to decide on the next step.
But it is "a major blow and a major disappointment," he said as one of the girls could be heard gurgling in the background.
"It comes as quite a shock," he added.
The judgement "fits within this larger picture of very harsh resistance to make any progress in terms of equal rights for all," he said.
The twins were born in South Africa’s port city of Durban on March 13, with their South African birth certificates listing Luehl and Delgado as the parents.
Namibia's home affairs ministry has however refused to recognise the couple's December 2014 marriage in South Africa.
Homosexuality is illegal in Namibia under a rarely enforced 1927 sodomy law dating back to South African rule.
But South Africa has since moved on and is now the sole African nation which allows gay marriage, since legalising it in 2006.