Taiwan’s top court on Wednesday ruled in favour of making same-sex marriage legal in the country, saying the current laws violate its citizens’ constitutional rights to freedom of marriage and equality. The Taiwanese Parliament has been given two years to change the provisions of its civil code that say a marriage should only be between a man and a woman.

Once the government amends the law or brings in new ones, Taiwan will become the first country in Asia to legalise same-sex marriage. If the government does not change the rules, same-sex couples can marry anyway after two years, the court ruled. The bench said the new law would bring about social stability and protect the dignity of Taiwan’s citizens.

Taiwan has been at the forefront of LGBTQ rights movements in the region. President Tsai Ing-Wen has spoken in favour of same-sex marriage several times since she was elected in January 2016. However, conservative groups have opposed any changes to the law, staging massive protests against such a move.

Countries in Asia have lagged behind several others when it comes to ensuring equal rights for LGBTQ citizens. Many face open persecution and law enforcement for their sexuality alone with marital rights remaining a distant reality. Indian law, too, makes it possible for authorities to act against homosexuality. Section 377 of the Indian Penal Code makes “carnal intercourse against the order of nature” punishable even if it is between two consenting adults – a law that particularly affects members of the LGBTQ community. The Supreme Court is currently considering a petition to strike down Section 377.