The Mediterranean country of Malta adopted the world's most progressive gender identity law on Wednesday in a final vote by the country's parliament on Wednesday.

The law is the latest in a series of LGBT rights laws ushered in by the Labour Party after taking power in 2013, a dramatic about-face for the country which has a constitution establishing Catholicism as the official religion.

Catholic teachings have long held great influence over Maltese family law; Malta was among the last countries in the world to approve to divorce, which voters did by a narrow referendum in 2011. (The vote left the Philippines and the Vatican as the world's only countries with no provisions for divorce.)

The law — which goes beyond those its fellow European Union members have passed — would allow for someone to change their legal gender through simply filing an affidavit with a notary without a significant waiting period, eliminates any requirement for medical gender reassignment procedures, and prohibits discrimination on the basis of gender identity. It now heads to the desk of President Marie-Louise Coleiro Preca, and LGBT rights advocates expect her to sign.

It also includes some groundbreaking provisions for minors and intersex babies, those born without clearly male or female anatomy. Medical experts estimate that around .1 - .2 percent of children are born with atypical genitals that cannot be classified as either male or female, and in much of the world doctors operate on these children to make their anatomy clearly male or female.

But the Maltese law prohibits "non-medically necessary treatments on the sex characteristics of a person" without informed consent and also allows parents to postpone entering a gender marker on a child's birth certificate.

"The Government of Malta has put LGBTIQ equality firmly on its agenda and is keen on putting in place the right legislative and policy framework," Silvan Agius, policy coordinator for Human Rights in Malta's Ministry for Social Dialogue, Consumer Affairs, and Civil Liberties. This was part of the Labour Party's campaign platform, he noted, and the government formed an "LGBTIQ Consultative Council" with human rights organizations to help them craft legislation.

One of the current government's first acts upon taking office in 2013 was settling a seven-year human rights lawsuit brought by a trans woman who was being denied the right to marry her male partner. Maltese courts ruled she was not legally considered female, despite having successfully changed her gender on identity documents and there was no provision for same-sex marriage under Maltese law. In addition to the 2014 civil union law — which provides all the legal rights of marriage — the government also ushered through an amendment making Malta the first European country to ban discrimination on the basis of gender identity in its constitution.

"To say that this Act is a groundbreaking human rights milestone is almost an understatement," said the co-chair of the European branch of the International Lesbian and Gay Association, Paulo Côrte-Real, in a statement issued following the vote. "It provides an inspirational benchmark for other European countries that need to improve their own LGBTI equality standards. The Act is a beacon of hope — and bears testament to the political leadership and hard work of the LGBTI movement in Malta."

The Catholic hierarchy, which fought the 2011 divorce referendum so aggressively that its leaders felt obliged to apologize for the tone of their campaign, appeared to have kept a low-profile ahead of the vote. It issued "comments and concerns" about the bill in December that objected to enshrining what it described as "gender ideology according to which people can freely determine whether they want to be male or female and freely choose their sexual orientation arbitrarily." But it did so only after praising steps to create a "a 'culture of dignity' in which every citizen, irrespective of nationality, status, sexual orientation, gender, age or achievement, lives in an inclusive culture of recognition between human beings" and said that "those experiencing issues related to their gender identity" have "a right to equality and should not suffer any form of discrimination, stigmatization and marginalization."

The Maltese archdiocese has not issued any press statements about the bill since then, according to the media page of its website. The archdiocese did not respond to BuzzFeed News's request for comment on Wednesday.