(Getty)

The high court in Germany has ruled in favour of equality for gay couples who had children via a surrogate abroad.

Germany lags behind most of Western Europe on LGBT rights, with a ban on same-sex marriage and only limited registered partnerships, no parenthood rights, and no joint adoption. All surrogacy is illegal on German soil.

Activists are celebrating a limited victory, after the court in Karlsruhe ruled in favour of two men who were not permitted to register as their son’s parents.

The men had a child via a surrogate in California in 2010 – but despite being registered as the child of both men in the US, upon their return to Germany authorities refused to recognise the family.

According to Deutsche Welle, the court ruled that Germany must respect the decision of the US in the case, as “part of a child’s welfare to be able to rely on the parents to have continuous responsibility for its well-being”.

The ruling means that surrogacy will remain illegal in Germany – but same-sex couples wishing to have a child via a surrogate could do so in another country, and will still be recognised if they return to Germany.

Berlin’s Social Democrat mayor Klaus Wowereit – one of Germany’s first prominent gay political figures – announced recently that he is to leave office two years early, over an ongoing row regarding the city’s airport.