Spain's parliament has given final approval to a law allowing people over 16 to change their legally-recognised gender without medical evaluation.
It passed with 191 votes in favour and 60 against, the final step in an extensive debate.
The process to change gender on documents could in theory now take around three to four months.
Another law passed on Thursday includes paid menstrual leave for women suffering severe period pain.
Previously, people needed a medical diagnosis of gender dysphoria and to have been on hormonal treatment for two years to change their gender on their ID card.
Now, they can identify as another gender and confirm it three months later. Those aged 12 to 13 will need a judge's approval while people aged 14 and 15 will need parental permission.
Before the vote, equality minister Irene Montero told lawmakers that "trans people are not sick people, they are just people".
She was pictured smiling outside congress after the law was passed, bringing a 20-month-long parliamentary debate to a close.
But the law was not universally welcomed. One protester, Patricia Bilbao, said: "We are here to support the rights of women as they are completely erasing us with these misogynist laws."
In 2014, Denmark was the first European country to pass a similar law, and is one of nine countries in the continent that have adopted self-declaration systems.
Sweden, which in 1972 was the first to make gender transition legal at all, has recently restricted hormone treatment and mastectomies to those over 18.
In January, Scotland's gender reform bill, passed by the Scottish government, was blocked by Westminster who said it could have a "serious adverse impact" on existing laws in the UK.
On Thursday, Spain also became the first country in Europe to pass legislation giving women paid menstrual leave, something Ms Montero added was a legislature "of feminist conquests."
The law means the state will pay sick leave for women suffering severe period pain, if they have a doctor's note.
It has been met with resistance, with the UGT trade union concerned that employers will favour hiring men.
Also, abortion access was increased in public hospitals and minors can now undergo the procedure without parental permission at ages 16 and 17.
Menstrual and contraceptive products will also be freely distributed throughout high schools.
(c) 2023, BBC News