Taiwan's constitutional court has declared that same-sex couples have the right to legally marry – the first such ruling in Asia – sparking celebration by activists who have been campaigning for the right for years.

Taiwan gay marriage
Supporters hug each other during a rally after Taiwan's constitutional court ruled that same-sex couples have the right to legally marry, the first such ruling in Asia Tyrone Siu/Reuters

In its majority opinion, the court said a provision in the current civil code barring same-sex marriages violated two articles of the constitution safeguarding human dignity and equality under the law. Authorities must now either enact or amend relevant laws within two years, failing which same-sex couples could have their marriages recognised by submitting a written document, the court said.

A bill to enforce the ruling is already working its way through the legislature, where both the ruling and major opposition parties support legalisation of same-sex marriage. Surveys show a majority of the public is also in favour, as is President Tsai Ing-wen, Taiwan's first female leader.

The ruling was greeted with rapturous applause outside the legislature not far from the court in the centre of the capital, Taipei, where hundreds had gathered with rainbow flags and noisemakers emblazoned with slogans in favour of gay marriage. "This ruling has made me very happy," said Chi Chia-wei, a veteran gay rights activist who had petitioned the court to take up the issue.

Taiwan gay marriage
Chi Chia-wei, 59, a gay rights activist, one of the petitioners who brought the case to the constitutional court Tyrone Siu/Reuters

Ahead of the ruling, Reuters photographer Tyrone Siu captured portraits of same-sex couples and asked them about their hopes for the future.

Despite the spread of same-sex marriage in a few regions since 2001, gay and lesbian couples have been allowed to marry in only 22 of the world's nearly 200 countries. Taiwan is the first government to legalise such unions in Asia, where socially conservative attitudes largely hold sway, while South Africa is the only country in Africa to allow them. More than 70 countries continue to criminalise homosexual activity.

Globally, the pace of civil rights victories has slowed against the background of a steady stream of reports of anti-gay violence and persecution. Recent weeks have witnessed large-scale detentions of gay men in Nigeria and Bangladesh, and accounts of roundups and torture of scores of gays in Chechnya. In Indonesia, a major police raid on a gay sauna was followed two days later by the public caning of two gay men.