RIGA, Latvia — The Estonian Parliament narrowly passed legislation that would give legal protections to same-sex couples on Thursday, positioning it to become the first former Soviet country to recognize these unions.

The legislation, called the Cohabitation Act, allows both same-sex and opposite-sex couples to register to receive almost all the benefits of marriage, though it restricts some adoption rights. The bill passed on a vote of 40 to 38, with several abstentions. Estonian President Toomas Hendrik Ilves announced on Twitter that he had signed the law, which will take effect in 2016.

Although the bill does not establish full marriage equality, Aili Kala of the Estonian LGBT Association told BuzzFeed News that it was a "landmark case" because no other former Soviet republic has established this level of protections for same-sex couples.

Russia and its proxies have used opposition to LGBT rights as a tool to try to foster hostility throughout Eastern Europe towards the European Union, which Estonia joined in 2004. Kyrgyzstan, a mostly Muslim nation in Central Asia, is poised to pass a ban on "homosexual propaganda" closely modeled on a Russian law passed last year.

The Estonian legislation comes as there has been increasing tension between the Baltic states and Russia, including allegations that Russia has kidnapped Lithuanian and Estonian nationals.

"It [says] to Europe that we are with you," Kala, the LGBT activist, said. "Russia can see that we want to [stay] in the EU and get more support from EU countries."