The conservative ruling party of Hungarian Prime Minister Viktor Orbán introduced the legislation, which is the latest effort to curtail the rights of gay men, lesbians, bisexuals, and transgender people in the nation.

Hungary's National Assembly passed the bill on a 157-1 vote. The ruling Fidesz party and its ally the Christian Democratic People's Party have a parliamentary majority, but lawmakers from the right-wing Jobbik party also endorsed the measure. One independent lawmaker voted against it.

All other opposition parties boycotted the voting session in protest. Human rights groups had strongly denounced the measure, seeing it as a tool that could be used to stigmatize and harass citizens because of their sexual orientations and gender identities.