Image copyright Getty Images Image caption A 46-year-old man has won a landmark case in Singapore

A gay Singaporean man has won a landmark court case which will allow him to adopt a child he fathered through a surrogate.

The man, 46, and his long-term partner carried out the process in the US at a cost of $200,000 (£159,000), as surrogacy is illegal in Singapore.

He tried to legally adopt the child but the bid was rejected last year, leaving him with no legal parental rights.

Same-sex marriages are not recognised in Singapore and gay sex is illegal.

The four-year-old child is considered illegitimate in the eyes of the law as the surrogate mother and biological father are not married.

The mother - who waived all her rights under the surrogacy deal - is also foreign, making the child ineligible to automatically qualify for Singaporean citizenship. The egg donor has never been identified.

The father was left with no legal rights parental, though was allowed to make decisions on the child's behalf.

The 46-year-old, who has been in a relationship with another Singaporean man for about 13 years, will have sole parental rights of the child when an adoption takes place.

Under Singapore law, children can be adopted by singles or by married couples. However, as the man cannot legally marry his partner - he would have to file his adoption as an individual.

'Child's best interest'

The man's initial bid to adopt his child was rejected last December, though the judge at the time said the decision was not a judgement on what "a family unit ought to be".

Instead, Judge Shobha Nair said it was about the ethics of commercial surrogacy.

On Monday, Singapore's High Court ruled that the man - who cannot be identified - would be able to adopt his child.

"Our decision should not be taken as an endorsement of what the appellant and his partner set out to do," said Chief Justice Sunderesh Menon in his judgement.

He said that there was "significant weight" put towards the concern that the ruling would "not violate the public policy against the formation of same-sex family units".

However, he added that in this case, there was a "statutory imperative to promote the welfare of the child... to regard his welfare as first and paramount".

Speaking to the BBC, lawyer Ivan Cheong said his client was "overjoyed and happy that at the end of a long adoption process, the child's welfare is upheld".

"At the end of the day, it is about what is in the child's best interest," Mr Cheong of Eversheds Harry Elias LLP said.

"Being recognised as a legitimate child and having his long term residential status met have always been our client's primary concerns."

The gay rights movement has gained significant momentum across some parts of Asia, though gay marriage still remains illegal - and a highly contentious issue - in socially conservative Singapore.

Although sex between men is criminalised, the law is not enforced and there are gay bars and clubs in Singapore, as well as an annual pride rally.