Lawmakers in Slovenia have approved a bill that grants marriage and adoption rights to gay and lesbian couples.

According to Euronews, the Slovenian parliament approved the bill last week with the support of 48 MPs. Twenty-nine lawmakers voted against the measure, while one abstained.

The move comes after the Constitutional Court of Slovenia ruled it unconstitutional to deny such rights to same-sex couples and gave lawmakers six months to amend the nation's marriage laws. The court's ruling took effect immediately.

Slovenia is the first country of the former Eastern Bloc to legalize same-sex marriage. (A reunited Germany legalized such unions in 2017.)

Gay couples could marry briefly after lawmakers approved a same-sex marriage bill in 2015. However, opponents defeated the law with a popular vote on December 20, 2015.

Since 2017, Slovenia has recognized gay couples with civil partnerships, which provide all the rights of marriage except for joint adoption and in vitro fertilization. A more limited form of partnership for same-sex couples was approved in 2005.

The Slovenian Democratic Party remains vocally opposed to marriage equality and held several rallies against the new law.