Croatia's top court said Friday that same-sex couples have the right to foster children, an issue that has provoked heated debate in the staunchly Catholic country.While gay marriage is not legal in Croatia, LGBT couples have been free to register as "life partners" since 2014 and earn the same rights, except when it comes to adoption.The fostering issue was taken to Croatia's constitutional court over a 2018 law that did not cite same-sex couples as among those eligible to take in children.Rights groups slammed the legislation as discriminatory and unconstitutional.On Friday the court published its ruling that the law itself was valid, but that excluding gay couples from its provisions was discriminatory to "same-sex oriented people ...which is constitutionally unacceptable". Croatia's constitution "guarantees same-sex families equal participation in all aspects of social life, including access to ... foster parenting," the court added in a statement. The EU member state, where the Catholic church plays an influential role in society, has seen a gradual liberalisation of gay rights in recent years.But there is still active resistance among religious groups on the fostering issue, as well as efforts to curb abortion rights.During a 2018 debate on the foster law, Stevo Culej, an MP of from the ruling conservative HDZ party, asked another deputy whether he would "give a child to two (participants) of the gay pride parade with bare butts."On Friday rights groups welcomed the court's ruling as a landmark decision."It is really a historic ruling in Croatia," Daniel Martinovic of Rainbow Families, an association of same-sex parents, told AFP."The court did something that our politicians didn't for years ... to rule that same-sex couples and LGBTI people in Croatia in general should have the same level of rights as heterosexual couples and other non-LGBTI people." Around 360 gay couples are registered as life partners in Croatia, which is home to 4.2 million people.