Lawmakers in Taiwan approved legislation on Friday legalizing marriages between couples of the same sex, making it the first country to do so in Asia.

The legislature legalized gay marriage despite a referendum last year in which over half of voters rejected the concept.

The country’s parliament passed legislation on Friday to legalize same-sex marriage by a majority of 66-27, becoming the first Asian state to do so. The bill also provided limited opportunities for same-sex couples to adopt.

The vote came almost two years after the country’s Supreme Court ruled that the existing definition of marriage between a man and a woman was unconstitutional, and gave parliament two years to come up with legislation around the issue.

Before the vote, thousands of LGBT rights campaigners gathered in the rain outside the parliament building in the capital Taipei to await the result, with shouts and tears of joy after it was announced.

“Today the result was the best we got for this stage,” Wu Tzu-an, a 33-year-old gay artist, told CNN. “It’s also a sign to show that Taiwan was different from China. Personally, I don’t have plans to get married, but I think it’s a sign for equality.”

The issue has proved bitterly divisive for Taiwanese society, with two-thirds of the country (67 percent) voting against the proposal in a referendum last November, backing the claims of campaign groups arguing that it would undermine the meaning of the traditional family. However, the referendum was merely advisory, and thus had no legal significance.

The legislation was supported by Taiwanese President Tsai Ing-wen, who suggested that other regional countries should follow their example in the pursuit of “progressive values.”

“Good morning, Taiwan,” she wrote. “Today, we have a chance to make history & show the world that progressive values can take root in an East Asian society. Today, we can show the world that #LoveWins.”

“On May 17th, 2019 in Taiwan, #LoveWon,” she later followed up. “We took a big step towards true equality, and made Taiwan a better country.”

Attitudes towards homosexuality are more liberal in East Asia than other parts of the continent, with countries such as Hong Kong, South Korea, Japan, Mongolia, and Macau all providing legal protection to LGBT people.

Even in communist North Korea, there are no laws actively discriminating against LGBT people within the penal code, although engaging in any form of LGBT rights activism is highly illegal and could result in punishment as severe as the death penalty.

Follow Ben Kew on Facebook, Twitter at @ben_kew, or email him at bkew@breitbart.com.