Taiwan’s parliament, the Legislative Yuan, on Friday approved a bill to legalize same-sex marriage, making the island the first country or territory in Asia to do so.

The country’s top court had ruled in 2017 that homosexual couples should enjoy the same marriage rights as heterosexuals, and gave parliament a two-year deadline, which expires on May 24, to implement or make amendments to the law.

Legislators had been debating three bills on the legalization of same-sex unions, two of which were tabled by conservative MPs and which referred to homosexual partnerships and “unions”.

The government’s bill, the most progressive of the three proposals, was approved.

“On May 17th, 2019 in Taiwan, #LoveWon. We took a big step towards true equality, and made Taiwan a better country”, President Tsai-Ing wen wrote on Twitter after the vote in parliament.

Over 35,000 people in Taipei braved a heavy downpour to march to the parliament building to urge lawmakers to legalize same-sex marriage.

Homosexual couples will be able to officially register their marriages from May 24.

Ahead of Friday’s vote, President Tsai had urged parliament to “make history and show the world that progressive values can take root in an East Asian society."

While the ruling has been welcomed by progressives, the issue has divided the island.

Tseng Hsien-ying, president of the Coalition for the Happiness of Our Next Generation, said that Taiwan had voted in a referendum in November last year in favor of maintaining the definition of traditional marriage in the Penal Code and said the government was “trampling on the will of the people”.

In February, the Taiwanese government had presented a bill that laid the legal framework for same-sex unions without changing the Civil Code.

The bill sought to combine the outcome of the Nov. 24 referendum - which demanded that the traditional definition of marriage not be changed - with an earlier constitutional interpretation allowing for equal rights for homosexuals, government spokesperson Kolas Yotaka had said at the time.