In what has been touted as the first in Asia, Taiwan’s parliament legalised same-sex marriage on Friday as the government survived a last-minute attempt by conservatives to pass watered-down legislation.

Lawmakers comfortably passed a bill allowing same-sex couples to form “exclusive permanent unions” and another clause that would let them apply for a “marriage registration” with government agencies.

The vote — which took place on the International Day Against Homophobia, Transphobia and Biphobia — is a major victory for the island’s LGBT community and it places the island at the vanguard of Asia’s burgeoning gay rights movement.

Thousands of gay rights supporters gathered outside parliament despite heavy downpours, waving rainbow flags, flashing victory signs and breaking into cheers as the news filtered out.