BUCHAREST, Romania — A referendum in Romania on whether to narrow the constitutional definition of a family to a man and a woman failed spectacularly over the weekend, with just 20.4 percent of the voting population taking part.

Romania is one of six European Union countries that does not allow same-sex marriage or civil unions. But its Constitution uses gender-neutral language to define “family,” and conservative groups, fearing that could lead to legal recognition for same-sex relationships, sought the referendum.

With opposition groups boycotting the vote, the new constitutional language was expected to win the support of a majority voters. But turnout was so low that the referendum results appeared invalid, leaving the existing definition of family in place.

The turnout was far below 30 percent, the threshold for a referendum to be binding, despite a decision by the government, which had largely backed the referendum, to allow two days of voting rather than one. Final results are expected to be released on Monday.

The vote has dominated public discussion in Romania in recent weeks, shifting conversation away from corruption  and proposed changes to the justice system  that critics say could weaken the rule of law.

Opponents of the referendum said that just holding it set back human rights in Romania.

Days before the vote, 47 members of the European Parliament sent a letter to Romania’s prime minister voicing their opposition, saying it affected not only L.G.B.T. families but also “single-parent families, nonmarried partners with children” and “grandparents raising their grandchildren.”

Amnesty International spoke out against the referendum, saying that limiting the definition of family could increase discrimination. Romania, where homosexuality was legalized in 2001, ranks 25th out of 28 European Union members on issues like equality, nondiscrimination and legal recognition for L.G.B.T. people, according to ILGA-Europe, a Brussels-based advocacy group for gay and transgender rights.

“From what we are hearing, there has been an increase in hate speeches and other forms of attack” since 2016, said Barbora Cernusakova, Amnesty International’s researcher on Romania.