A group of kids play next to a Rainbow flag during the 4th European Meeting of Rainbow Families for gay, bisexual and transgender persons in Oeiras on the outskirts of Lisbon on October 17, 2015. (Jose Manuel Ribeiro/AFP/Getty Images)

In Portugal, a new gender change law approved Friday means transgender people in the country will no longer need to be diagnosed as mentally ill to legally change their gender and unnessary surgery on intersex infants is banned.

Several European nations require transgender people to undergo medical procedures such as surgery and sterilization, be diagnosed with a mental disorder, and get divorced if married to have their desired gender legally recognized by government.

The law makes Portugal only the sixth European nation to allow a change of gender without medical or state intervention, according to ILGA-Europe, a network of lesbian, gay, bisexual, transgender and intersex (LGBTI) groups.

It follows Malta, Norway, Denmark, Ireland and Belgium.

People who are transgender do not identify with the gender they were born as, while intersex people have ambiguous genitalia that are not considered typically male or female.

“When trans people are trusted to take decisions for themselves, it signals respect (and) procedures are simplified,” said Transgender Europe’s senior policy officer Richard Kohler.

“It enables anyone who needs legal gender recognition to quickly get through with this bureaucratic step and continue with their lives,” he told the Thomson Reuters Foundation.

The law also means Portugal will become only the second nation in the world, after Malta, to ban medically unnecessary surgery on the genitals of intersex infants, activists said.

About 1.7 percent of the world’s population, or 129 million people, is thought to be born intersex, the United Nations says.

Doctors often perform surgery to “masculinize” or “feminize” the genitalia of intersex babies aged 2 or under in the belief it will make their lives easier and to ease parental distress.

Transgender people in Portugal will no longer need to be diagnosed as mentally ill to change their gender legally, after parliament approved a law on Friday that also bans unnecessary surgery on intersex infants.