According to reports, the court agreed that Taiwan's current Civil Code, which stipulates that marriage must be between a man and a woman, violates constitutional guarantees of freedom of marriage and equality.
Hundreds of same-sex marriage supporters celebrated in Taipei outside the legislature, in a demonstration held by gay rights group Marriage Equality Coalition.
While China took homosexuality off its official list of psychiatric disorders in 2001, it is still a long way from legalizing same-sex marriage as gay couples in China have found courts reluctant to uphold their rights.
Gay rights activist Chi Chia-wei was one of the petitioners who brought the case to the Constitutional Court.
Yu said the court's explanation means that even if lawmakers do not pass legislation allowing same-sex marriage in the next two years, gay couples will still be able to marry by this time in 2019.
The decision is binding, so a ruling in his favour would pave the way for same-sex unions to be legalised. This led to its first national election in 1996.
The ruling is likely to reverberate around the region, with calls for marriage equality rising in a number of countries, including South Korea and Japan.
Lawyer Huang Di-ying said the court's decision was "historic". "This is a step forward in human rights", said the 60-year-old retiree, who asked that only his first name be used.
Taiwan has always been considered a beacon of LGBT rights in Asia, specifically for its annual Taipei gay pride march, the largest in Asia.
The chair of Tsai's rival party Kuomintang (KMT), Wu Den-yih, seemed to rejoice at the ruling, posting the picture of a rainbow on Facebook and changing his status to "feeling great".
The LGBT community hopes legislators will simply amend the existing marriage laws to include same-sex couples, which would grant them the same rights enjoyed by opposite-sex couples, including in cases of adoption, parenting and inheritance - and making decisions for each other in medical emergencies.
Jamie, who has been in a relationship with his partner for 22 years, said the ruling was a milestone for Taiwanese society.
Groups opposing same-sex marriage, including Coalition for the Happiness of Our Next Generation, protested outside the Judicial Yuan after the result came out.