Taiwan's top court ruled in favor of gay marriage Wednesday, a landmark decision that paves the way for the island to become the first place in Asia to legalise same-sex unions.
Crowds of supporters cheered, hugged and wept as the court said current laws preventing the practice "violated" the constitution's guarantees of freedom of marriage and equality.
It gave the government two years to implement the ruling.
Momentum has been growing behind the push for equal marriage rights, with Taiwan's president Tsai Ing-wen openly supporting the campaign.
But there has also been anger among conservative groups, who have staged mass rallies against any change in the law.
The constitutional court said if parliament does not make the change within two years, same-sex couples could register to marry regardless, based on its interpretation.
Currently Taiwan's Civil Code stipulates an agreement to marry can only be made between a man and a woman.
"The current provisions of the marriage chapter do not allow two persons of the same sex to create a permanent union of an intimate and exclusive nature for the committed purpose of managing a life together. This is obviously a gross legislative flaw," the court said in a statement.
The decision to allow gay marriage would bolster social stability and protect "human dignity" it added.
Hundreds of gay marriage supporters gathered outside parliament in central Taipei erupted at the news, some breaking down in tears.
For Taiwan's pioneering gay rights campaigner, Chi Chia-wei, one of the petitioners who brought the case to the constitutional court, it was the culmination of 30 years of activism.
"I'm leaping with joy like a bird," Chi, 59, told AFP.
"I hope parliament will prioritise the bill instead of dragging it on for another two years," he added.
The other petitioner was the Taipei city government, which has been rejecting marriage applications by same-sex couples and was seeking clarification of the law.
"This will open doors for a lot of other countries in the region," said Toby Chang, 28, at the rally.
"It's also good for Taiwan. It will bring a lot of international attention and recognition," he added.
Calls for marriage equality are gaining strength in a number of countries around Asia, including South Korea and Japan.
The ruling also raised hopes among supporters in mainland China.
"Taiwan and mainland China have the same roots and culture," said Li Yinhe, a renowned Chinese sexologist who has pressed Beijing policymakers to legalise same-sex marriage.
"It suggests that Chinese society could also accept the idea of gay marriage," she said, but added there was "a very long way" to go.
Last year, two men lost a legal battle to marry, but the decision by the court in central China to hear their case was seen as a breakthrough.
Fears of delay
President Tsai urged society to "understand, tolerate and respect people with different opinions" in a statement after the ruling, adding the decision was binding.
However, some campaigners fear opposing voices in parliament may try to delay the process of changing the law.
Outside Taipei's main judicial headquarters, angry anti-gay marriage protesters beat drums shouting "unfair justice" and "sinners".
"The welfare of the majority should not be sacrificed to please a few people," said demonstrator Becky Huang.
A panel of 14 grand justices made the ruling — a majority of 10 was needed. Only two judges dissented.
The court said the physical and psychological need for permanent unions was "equally essential to homosexuals and heterosexuals, given the importance of the freedom of marriage to the sound development of personality and safeguarding of human dignity".
It also pointed out that attempts in parliament to legalise gay marriage have stalled for more than a decade, affecting people's fundamental rights.
Proposals to amend the Civil Code finally passed their first reading in December, but have not progressed further.
Rights group Amnesty International urged the government to act quickly.
"As today's ruling makes clear, whoever you love, everyone is entitled to the same human rights and equal protection under the law," it said.