Taiwan became the first country in Asia to legalize same-sex marriage in a landmark court ruling on Wednesday. The Constitutional Court gave the government two years to enact relevant legislation.

"The need, capability, willingness and longing, in both physical and psychological senses, for creating such permanent unions of intimate and exclusive nature are 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," the ruling read.

Hundreds of marriage equality supporters cheered and wept on the courthouse steps as the news was announced.

Happy news after weeks of bleak headlines

Approval for gay marriage and expanding LGBT rights has been gaining traction in Taiwan for years. Where homosexuality is still treated with oppression and derision in other parts of the region, a strong and successful lobby has done wonders for public perception on the island nation, and every year the country's Pride celebrations are attended by hundreds of thousands. Even President Tsai Ing-wen, the country's first female leader, has been a vocal proponent of marriage equality.

"The party is happy to see and affirm the results of the grand justices' constitutional interpretation to guarantee and legalize same-sex marriage," Tsai's Democratic Progressive Party said in a statement.

It was a heartening decision after weeks of headlines about anti-gay violence around the world. Groups of gay men have been rounded up and detained in Nigeria and Bangladesh and there have been reports of widespread torture and intimidation of the LGBT community it Chechnya. At the same time, Indonesia's semi-autonomous Aceh province, which operates under fundamentalist Islamic law, ordered the public caning of two gay men.

Although gay rights still have far to go in east Asia, several countries in the region are signatories to the UN's declaration on LGBT rights - including Mongolia, Japan, South Korea, Nepal, Thailand and East Timor. In Japan, same-sex unions are recognized by some municipalities.

es/jm (AP, AFP)