Taiwan‘s parliament has legalised same-sex marriage in a landmark vote that made the self-ruled island the first in Asia to adopt such legislation.

The lawmakers comfortably passed a law on Friday, allowing same-sex couples to form “exclusive permanent unions” and a second clause that would let them apply for a “marriage registration” with government agencies.

The vote is a major victory for the island’s LGBT community who have campaigned for years to have similar of equal marriage rights as heterosexual couples and places the island at the vanguard of Asia’s burgeoning gay rights movement.

In recent months conservatives had mobilised to rid the law of any reference to marriage, instead putting forward rival bills that offered something closer to limited same-sex unions. But those bills struggled to receive enough votes.

Hundreds of gay rights supporters on Friday gathered despite heavy rain near the parliament building in the capital, Taipei, as legislators were set to vote on a series of bills that could offer same-sex couples similar legal protections for marriage as heterosexuals.

The vote came after Taiwan’s top court ruled that not allowing same-sex couples to marry violates the constitution. Judges gave the government until May 24 this year to make the changes or see marriage equality enacted automatically. But they gave no guidance on how to do that.

Bitter divisions

In a Facebook post, President Tsai Ing-wen said ahead of the vote that she recognised the issue had divided “families, generations and even inside religious groups”.

“Today, we have a chance to make history and show the world that progressive values can take root in an East Asian society,” she added in a Twitter post.

Tsai’s ruling Democratic Progressive Party (DPP) holds the majority in parliament, occupying 68 out of 113 seats.

Taiwan’s LGBT community has been left in limbo the last two years, with many couples planning weddings before the May 24 deadline but unsure of what marriage equality would look like.

“The world is watching to see if Taiwan’s parliament will write a new page in gender equality or deal another blow to Taiwan’s hard-fought democracy, human rights and the rule of law,” said Jennifer Lu, a spokeswoman for Marriage Equality Coalition Taiwan.

“For the gay communities what matters the most is whether we can legally get married on May 24 and be listed as the spouse in ID cards, to be treated and respected as the ‘spouse’ in the whole legal system … and whether same-sex families can obtain legal parental rights for their children.”

Cindy Su was one of the thousands of gay marriage supporters gathered outside parliament on Friday in the run-up to the debate.

“We are just a group of people who want to live well on this land and who love each other,” she told the crowd.