A man, who donated sperm to his gay friend, has parental rights over their daughter, according to a High Court verdict.

A man who donated sperm so his gay friend could have a baby more than a decade ago has parental rights over their daughter, Australia’s High Court ruled on Wednesday.

The court said that because the man was listed on the birth certificate and had an “extremely close” relationship with the girl, he was the father and should have a say in whether she is taken to live in New Zealand.

The man – who goes by the pseudonym ‘Robert’ for legal reasons – agreed to donate his sperm to a friend in 2006 via artificial insemination.

Despite them not living together, Robert had “an ongoing role in the child’s financial support, health, education and general welfare”, the court said.

Problems arose when the girl’s mother and her same-sex partner wanted to move to New Zealand in 2015.

Judge Margaret Cleary ruled that a lower court was wrong to rule against the father and concluded that the child should remain in Australia so he can have visitation rights.

It is unclear, given the specifics of this relationship, whether the case could set a precedent for future judgements.