The decision is a victory for Taiwan's LGBT activists, who have fought for decades for marriage equality, inspiring similar struggles across Asia and elsewhere.
Wayne Lin, chairman of the nongovernmental Taiwan Tongzhi Hotline Association, called the ruling a "milestone" for the island.
It is also a milestone for the region, gay rights activists said. "Without a doubt, Taiwan is walking in front of other Asian countries on this," said Ying Xin, executive director of the Beijing LGBT Center. "This is significant for all of Asia."
Taiwan has long been seen as a leader on lesbian, gay, bisexual and transgender rights. While Indonesia arrests and beats gay people, Singapore criminalizes gay sex and China cracks down on LGBT organizing, Taiwan has taken steps toward equality.
Gender and sexual minorities in Taiwan still face stigma and discrimination, but school textbooks extol equality, gays and lesbians serve openly in the military, and Taipei's annual gay pride parade draws revelers from across the world.
Taiwanese often attribute the relatively tolerant atmosphere to the island's cultural mix, which includes indigenous groups, Dutch and Japanese colonizers, and folk practices carried across the Taiwan Strait from mainland China.
But a bitter backlash to the groundswell of support for marriage equality has tested Taiwan's reputation for tolerance.
Over the past year, religious groups mobilized against marriage equality, claiming that same-sex marriage threatens children and families.
Led by church groups, anti-gay rights campaigners have resorted to inaccurate tropes about homosexuality, trying to link marriage rights to incest, bestiality and AIDS. At one point, one group warned that a same-sex marriage law would mean that "it's possible to marry a Ferris wheel."
Part of the opponents' strategy was to argue that protecting the rights of gender and sexual minorities is Western, that marriage equality threatens what it means to be Chinese or Taiwanese. (Taiwan is self-governing, but China considers it a part of its territory.)
At the last major court hearing on marriage equality, Taiwan's justice minister, Chiu Tai-san, claimed that same-sex relationships are a "newly invented phenomenon," unlike "social norms and mechanisms formed by the people of our nation over the past thousand years."
LGBT campaigners dismiss the notion that marriage rights are un-Chinese or un-Taiwanese — and think the ruling will bolster their fight more broadly.
"China and Taiwan speak a common language," said Li Maizi, a prominent Chinese feminist and LGBT activist. "This will inspire the LGBT movements' push for gay marriage."
Matthew Huang, founder of an LGBT group in the Chinese city of Chengdu, said simply, "It's hope."
In Taipei, activists will now turn their attention to influencing how legislators interpret the ruling and what that means for same-sex couples and families.
There is some fear among campaigners that lawmakers will appease opponents of same-sex rights by creating a special category for same-sex unions. In a news release issued after the ruling, Lin urged lawmakers to move without "hesitation" to amend the Civil Code to guarantee full equality.
Shirley Feng, Concong Zhang and Luna Lin in Beijing contributed to this report.