(Bloomberg) -- Carla Antonelli waved a baby blue, white and pink trans flag as the Spanish congress passed a bill that makes the country one of the few in the world where anyone over the age of 16 can easily change their gender on their identification card. In a sign of how fraught the debate had been, half of the chamber clapped, while the other half stayed silent.

It had become personal for Antonelli, the only trans person to have ever held a parliamentary seat in Spain. In October, she resigned as a member of the Socialist Party in protest over the governing party’s opposition to key parts of the bill, which was sponsored by its own coalition partner, the far-left Unidas Podemos group. Though the Socialists eventually backed down, the months-long battle over the age at which people would be allowed to self-identify hurt the unity of the movement and the public image of trans people, Antonelli said.

“This bill makes cosmic justice for trans people,” Antonelli said earlier this week as it became clear the law had enough support for approval in congress. “I’ve lost shreds of skin in this bloody battle and I ask myself if all that was necessary, or if the same could have been achieved without so much pain.” 

Transgender rights had until now been on the fringes in Spain. But in the past few years, political debate about their rights has gone mainstream as controversies more common in the English-speaking world have taken hold — in addition to the age of self-ID, there’s friction over which bathrooms they can use and whether trans rights come at the expense of women’s rights.

“Trans people are not sick, crazy, monsters or criminals,” Equality Minister Irene Montero said during the bill’s final debate in congress this week. “During the process of negotiating this bill transphobia has taken hold of the public debate and we are very aware of the pain that has caused.” 

As the national conversation intensified, the public heard more about the difficulties trans people face, including higher rates of suicide, depression and unemployment. At the same time, verbal attacks on the community were matched by an increase in reported hate crimes and violence against LGBTQ and, more specifically, trans people.

In Barcelona alone, documented cases of LGBTQ-phobia doubled in 2021 from the previous year and reports of trans discrimination increased four-fold, according to several reports cited by the city’s town hall. Data is scarce and patchy, and over two thirds of hate crimes against homosexual or trans people are never reported, according to Europe’s Fundamental Rights Agency. 

“We have seen transphobia go from shy speeches voiced by a minority to the mainstream,” Antonelli said. “Some people feel they can say absolutely barbaric things with total impunity.”  

It’s a surprising development as Spain is considered one of the most progressive nations on LGBTQ rights. In 2005, it became the third country in the world after the Netherlands and Belgium to legalize same-sex marriage. It is also one of the 10 European countries where trans people enjoy the most protections across a range of issues, including hate speech and crime, discrimination, health and family, according to TGEU, an advocacy group. 

It wasn’t always like that. A country with deep Catholic roots, Spain’s LGBTQ people were persecuted, jailed and subject to forced conversion therapies for almost four decades during General Francisco Franco’s dictatorship, which ended when he died in 1975. Some of the musicians, cinema directors and politicians who played a key role during the transition to democracy were LGBTQ people who openly voiced their identities.

The bill passed 188 votes to 150 in the congress on Thursday, with the minority ruling coalition voting in favor. The Socialists had initially fought against Unidas Podemos’ push to allow people younger than 16 to change their gender on the civil registry — and therefore on their identity cards and other official documents — without a judge’s authorization. 

Socialist Carmen Calvo, a congresswoman and the president of the congress’ Equality Commission who served as one of the government’s vice-presidents until 2021, led that effort.  On Thursday, she abstained from voting. A self-declared feminist, Calvo had expressed concern the law leaves children unprotected, and presents a challenge to gender equality and the rights women have won over time. Not everyone in the party supported her views, though, and so it relented.

On the opposite end of the political spectrum, Rosa María Romero, a congresswoman with the conservative Partido Popular, voted against the bill, saying it was rushed and that government parties ignored opposing voices from medical professionals, feminist associations and even female members of the Socialist Party, a veiled reference to Calvo.

The far-right Vox group, meanwhile, voiced some of the extremist arguments that trans activists have denounced. “This ideology destroys human nature,” said Vox congresswoman Carla Toscano. “They want 12-year-old children who are not old enough to drive or vote — who need parental permission to go on a school trip — to decide over their bodies, whether it be for an abortion, to take hormones or to mutilate themselves.” 

The final text of the Bill for Real and Effective Equality to Trans People eliminates requisites including medical and psychological exams and two-year hormone treatments for trans people to change their gender on the official registry. People over 16 will be able to do it freely, those aged 14-16 will need their parent’s permission and 12-14-year-olds will require a judge’s authorization.

It also bans conversion therapies and unifies protocols for public servants to address and assist trans people, a long-time demand from activists like Antonelli. The document will now be debated and voted on in the senate, where it is expected to pass as the Socialists hold a majority. But tensions are far from being resolved. 

Read More: How to Understand the Debate Over Transgender Rights

Spain’s debate follows a pattern seen elsewhere, according to Richard Köhler, activist and advocacy director at TGEU.

“In countries like Germany and the UK legislative proposals were going in the right direction, aiming for the self-determination of trans people, but they were poisoned by a public debate fueled by very well-connected and strategically-positioned actors,” Köhler said. “It’s very easy to manipulate people on the underlying fears that they have — they were very successful across the continent in pitching the protection and rights that trans people need against those of women.” 

Even so, “we have come a long way,” Köhler said. “The growing opposition is because the trans community has been hugely successful from a start when it was largely marginalized.” 

The Spanish face-off spilled over from congress into the media and demonstrations on the streets. Earlier this month, hundreds of people marched in Madrid to support the new law. Among them was Alaine Álvarez, a young trans woman who had to wait until she was 18 to start the process of getting her gender identity accepted and affirmed by law.

“I had to go to a psychiatrist who tested me to ensure I didn’t have a mental illness and diagnosed me with gender dysphoria, then came two years of hormone treatment,” said Álvarez, now a member of Fundación Triángulo, an advocacy group. “When I finally went to the civil registry I was discriminated against, and treated with masculine pronouns by people who told me I would never be able to change my name.” 

Young trans people are more likely to drop out of school, but, on the bright side, they’re more likely to hear about trans issues and to meet people going through similar experiences than older trans people.

“Being a young trans person is complicated,” said Teresa Saiz, whose 13-year-old son Luca revealed his gender to the family a year ago. “Everyone is very supportive when you tell them, but there are gaps and shortcomings in how they’re treated in their everyday lives.” 

Saiz, 47, marched along her sister and son in Madrid wearing a giant trans flag tied to her neck as a cape, and said the new law would help people like her son feel better about who he is.

“This is not about politics, this is about people,” she said. “All I want is my son’s happiness, so the least we can do is to fight alongside him.” 

©2022 Bloomberg L.P.