Germany’s highest court ruled today that one member of a civil partnership should be able to adopt their partner’s stepchild or adopted child.

Until now, same-sex couples could only adopt their partner’s biological child.

The new gay adoption laws are now in line with rules that apply to heterosexual couples and judges ruled that this was discriminatory.

Government legislation is to be drawn up by June 2014.

The historic ruling has been hailed as “a breakthrough in equal treatment” by Volker Beck, an openly gay senior lawmaker with Germany’s opposition Green Party.

However, the ruling only means that same-sex couples can adopt the same child on an individual basis and not as a couple and they still cannot adopt unrelated children.

“Today’s decision marks a historic step finally to put rainbow families in Germany on a comprehensive, secure legal footing,” Justice Minister Sabine Leutheusser-Schnarrenberger said. “Full adoption must be the next step.”

Same-sex civil partnerships have been legal in Germany since 2001.

In August, German Chancellor Angela Merkel rejected calls to give to LGBT couples the tax breaks enjoyed by heterosexual married couples.