MADRID (AP) — Spain’s lower house of Parliament Thursday passed a law that allows people over 16 years of age to change their legally registered gender without any medical supervision.

Under the Spanish law, drawn up by the center-left coalition government, minors ages 12and 13 will need a judge’s authorization to make the change, while those between 14 and 16 will have to be accompanied by their parents or legal guardians.

Up to now, Spanish transgender people needed a diagnosis by several doctors of gender dysphoria, which is the psychological condition of not feeling a match between one’s biological sex and gender identity. In some cases, they also needed proof they had been living for two years as the gender they identified with — or even records showing they had taken hormones.

Transgender rights groups say the law represents a “before and after” in LGBT rights. But some feminist activists regard gender self-determination as a threat that blurs the concept of biological sex.

On the same day, the Scottish Parliament passed a bill to make it easier for people to change their legally recognized gender. The approval makes Scotland the first part of the U.K. to have endorsed allowing people to declare their gender on documents without the need for medical certification.

The bill was introduced by the Scottish National Party-led government and allows people to transition by self-declaration, removing the need for a medical diagnosis of gender dysphoria.

The new rules require anyone applying for a Gender Recognition Certificate to have lived full-time in their declared identity for three months – six months if they are ages 16-17 – as opposed to the previous period of two years. The bill lowered the minimum eligibility age from 18 to 16.

The revised law also establishes a three-month “reflection period,” during which applicants can change their minds. The Scottish government has not yet decided when in 2023 it wants the new process to take effect.

The government had argued the updates would improve the lives of transgender people by allowing them to get official documents that correspond with their gender identities.

Opponents, including “Harry Potter” author J.K. Rowling, claimed the simplified procedure could give predatory men access to spaces intended for women, such as shelters for domestic abuse survivors.

Attention will now turn to how the British government reacts. U.K. Equalities Minister Kemi Badenoch has voiced concerns about legal divergences between Scotland and the other constituent parts of the U.K.

In Spain, while the voting session was due to take place in Parliament, dozens of transgender rights activists gathered in front of the building listening to the debate on their mobile phones, while other trans right representatives attended the session problem the public gallery.

Saida García, vice president of the Euforia Trans Family Alliance group, told The Associated Press that the bill will bring a change to many of its members’ everyday lives.

“It’s always been a problem when your ID doesn’t match your identity in a job interview, or at the doctor’s office, or when boarding public transport,” she said. “We are so happy to get to this point. It seemed it was never going to come.”

The bill sponsored by the far-left Unidas Podemos, or United We Can party, the junior partner in the coalition government, will become law once it is passed by the Senate, a step expected by the end of the year.

Its passage in the lower house followed an intense 18-month-long parliamentary debate. It was fiercely opposed by right-wing opposition parties and also created some divisions with the Socialist party of Prime Minister Pedro Sánchez.

The Socialists tried to introduce an amendment requesting court supervision for people up to age 16 wanting to change their registered gender. The version approved Thursday included the requirement only for people under 13.

More than a dozen other countries have already adopted similar legislation.

___

Ciarán Giles contributed to this report