A top court in Slovenia ruled that imposing bans on same-sex couples getting married and adopting children is unconstitutional and has ordered its parliament to amend the law within six months.

Constitutional court judges ruled 6-3 on both issues in question on Friday (8 July), saying that Slovenia’s current laws allowing only opposite-sex marriages and adoptions violated a constitutional prohibition against discrimination. 

Discrimination against same-sex couples “cannot be justified with the traditional meaning of marriage as a union between a man and a woman, nor with special protection of family,” the ruling stated according to the Slovenian Press Agency.

The ruling makes Slovenia the 18th country in Europe and 31st worldwide to legalise same-sex marriage. It also makes it the first country of former Yugoslavia to legalise same-sex marriage.

While the court gave the legislators six months to amend existing laws to conform with the ruling, Luka Mesec, the Minister of Labour, Family, Social Affairs and Equal Opportunities, said the required changes would be ready within a week or two. 

“The constitutional court has ordered us to do it, and we will do it with the greatest pleasure,” Mesec said.

Up until now, same-sex couples had been confined to civil unions which gave them some but not all of the rights possessed by heterosexual couples.

Back in 2015, a bill to legalise same-sex marriage had been approved by Parliament in March of that year, however it was then rejected in a referendum eight months later in December.

The country’s top court took the issue up once again following complaints by two same-sex couples who were both unsuccesful in front of regular courts in their fight to get married and adopt.