The new amendment also makes it almost impossible for anyone other than married couples to adopt children.
Slovakia's parliament passed an amendment to the constitution on Friday that recognises only two sexes, along with other measures that critics say might breach the country’s international obligations and undermine the protection of human rights.
The amendment, which was drafted by Prime Minister Robert Fico's government, required a three-fifths majority.
It passed with 90 votes in the 150-seat National Council, with 12 lawmakers from the conservative opposition helping the ruling coalition win the vote.
The amended constitution now recognises only two sexes, male and female, and states that Slovakia retains sovereignty in matters of "national identity," which is not specifically defined, especially in "fundamental cultural-ethical questions."
The amendment also makes it almost impossible for anyone other than married couples to adopt children.
The constitution had already defined marriage as "a unique union between a man and a woman."
Parental consent is now needed for access to sexual education and equal pay for men and women is guaranteed.
Justice Minister Boris Susko told parliament that the amendment should boost traditional values.
International condemnation
Amnesty International condemned the move.
"Today, the Slovak government chose to follow the lead of countries, such as Hungary, whose policies have led to an erosion of human rights," it said in a statement.
Council of Europe Commissioner for Human Rights Michael O’Flaherty previously urged lawmakers not to give a green light to the changes.
He said they deny "the realities of trans and intersex people and may impact on human rights guarantees such as access to legal gender recognition."
"Seeking to disapply specific rights because they touch upon 'national identity' would be fundamentally incompatible with the Slovak Republic's international obligations," he added.
Fico has long been a divisive figure, both at home and across Europe.
His critics claim that under his rule Slovakia has abandoned its pro-Western course and is tilted more towards Moscow, in a similar vein to Hungary under Prime Minister Viktor Orbán.
Thousands of people have repeatedly rallied across Slovakia to protest Fico's perceived pro-Russian stance and other policies.
Fico has refused to fall in with the rest of the EU in slapping sanctions on Russia in response to its full-scale invasion of Ukraine and has said Ukraine will not be invited to join NATO.