In a landmark ruling on Tuesday, the European Court of Justice, the EU's top court, said that same-sex parents and their children must be legally recognized as a family in each of its 27 member nations. The case came before the court after Bulgarian authorities refused to give a birth certificate to the newborn daughter of a same-sex couple because same-sex marriages and unions are not recognized in Bulgaria. The girl, Sara, was born in Spain. One of her mothers was born in Bulgaria, the other in Gibraltar, a British territory, according to ILGA Europe, an LGTBI rights group that offered strategic legal support in the case. Because Sara was born in Spain, an EU nation where same-sex marriage is legal, both women were registered by Spanish authorities as mothers on the child's birth certificate. But under Spanish law, Sara can't get citizenship in Spain because neither of her mothers is of Spanish descent. She was also denied British citizenship because under the British Nationality Act of 1981, citizenship cannot be transferred to the child of a parent born in Gibraltar. Bulgaria's refusal to issue a birth certificate left Sara at risk of being stateless, unable to leave her country of residence, Spain, and with no access to citizenship, therefore limiting her access to education, health care and social security. "That refusal could make it more difficult for a Bulgarian identity document to be issued and, therefore, hinder the child's exercise of the right of free movement and thus full enjoyment of her rights as a Union citizen," a press release from the court said. In its ruling, the European Court of Justice found if one EU country acknowledges a child's parental relationship, all members must recognize it too, in order to guarantee their right to free movement between the countries. The court also determined that recognizing families with same-sex parents "does not undermine the national identity or pose a threat to the public policy" of another member state where same-sex marriage is not legal. Bulgarian authorities now have to issue a passport or identity card to Sara. "We are thrilled about the decision and cannot wait to get Sara her documentation and finally be able to see our families after more than two years," Sara's parents said in a statement. "It is important for us to be a family, not only in Spain but in any country in Europe and finally it might happen. This is a long-awaited step ahead for us but also a huge step for all LGBT families in Bulgaria and Europe." Speaking following the ruling, Arpi Avetisyan, head of litigation at ILGA-Europe, said the ruling "has brought long-awaited clarification that parenthood established in one EU member state cannot be discarded by another, under the pretense of protecting the 'national identity.'" He added that if countries refuse to implement the court's judgment, the European Commission can take legal action. "This is a true testament to the EU being a union of equality and we look forward to seeing rainbow families enjoying their right to freedom of movement and other fundamental rights on equal footing to anyone else," he said. "It is important that the judgment is implemented imminently, not only for baby Sara and her family, but also for other families facing similar struggles across the EU."