Romania’s ruling party aims to introduce legislation to legalize civil unions for same-sex couples, the state news agency quoted a cabinet minister as saying, after a referendum to curb such rights failed to draw enough voters to be valid.

Sunday’s referendum to change Romania’s constitution to prevent same-sex couples from securing the right to marry was seen as a key popularity test for the ruling Social Democrats (PSD), whose attempts to weaken anti-corruption legislation have been condemned by the European Commission.

But the referendum backfired as turnout was only 21 percent, below the minimum 30 percent required for validity. Analysts said voters had viewed the referendum as a ruse by the PSD, which supported the change, to divert attention from more pressing concerns.

“This draft bill is finalized and...my fellow lawmakers will submit it in parliament next week,” European Affairs Minister Victor Negrescu told the state news agency Agerpres.

The religiously conservative European Union state currently bans both marriage and civil unions for same-sex couples and does not recognize those performed abroad.

Earlier this year, Romania was forced by a European Court of Justice ruling to grant residency rights to gay spouses married in other EU states.

Previous attempts to legalize civil unions did not make it out of parliament’s legal commissions.

Dozens of human rights groups had said a successful referendum would embolden further attempts to chip away at the rights of minority groups and push Romania onto a populist, authoritarian track.

Romania decriminalized homosexuality in 2001, decades later than neighboring countries. It ranks 25th out of 28 EU states based on legislation, hate speech and discrimination toward LGBTQ people, according to an annual study by ILGA-Europe, an umbrella organization advocating equality.

FOLLOW NBC OUT ON TWITTER, FACEBOOK AND INSTAGRAM