"Today, we have a chance to make history and show the world that progressive values can take root in an East Asian society", Tsai wrote on Twitter before the vote.
Two years ago Taiwan's top court ruled that not allowing same-sex couples to marry violates the constitution with judges giving the government until May 24, 2019 to make the changes or see marriage equality enacted automatically.
Supporters campaigned outside parliament in the rain.
In Indonesia, declining secularism has led to deepening discrimination against the country's gay, lesbian and transgender communities.
People may not marry their direct or collateral relatives within four degrees of consanguinity, unless they are collateral relatives through marriage who are not within three degrees of kinship, it says.
"We need to take responsibility for the referendum previous year and we need to take responsibility for people who have suffered from incomplete laws or faced discrimination", ruling party legislator Hsiao Bi-khim said during the three-hour parliament session.
The landmark decision cements Taiwan's reputation as a beacon of liberalism in a region where the LGBT community faces increasing persecution, and will give a long-awaited boost to Asia's burgeoning gay rights movement. Same-sex couples can not co-adopt.
Several DPP legislators who have taken a conservative stance on same-sex marriage were absent from the legislative session yesterday, including Huang Kuo-shu (黃國書), Hsu Chih-chieh (許智傑) and Hung Chun-yi (洪宗熠).
Taiwan's vote sets it apart from other parts of Asia where LGBTQ rights have regressed.
Two other versions backed by conservatives avoided the word marriage and described same-sex partnerships as a "same-sex familial relationship" or "same-sex union".
"They don't need to worry about that anymore", Hsiao Bi-Khim, Democratic Progressive Party legislator, told the Morning Post. "We took a big step toward true equality, and made Taiwan a better country".
Under that act, even with the legalization of same-sex marriage in Taiwan, a Taiwanese national would not be able to enter into a legally recognized union with a partner from a country where gay marriage is not legal.
Vietnam decriminalised gay marriage celebrations in 2015, but it stopped short of full legal recognition for same-sex unions. At New Taipei Banqiao High School, students organised a week-long event in early May encouraging male classmates to wear skirts to support gender equality and challenge societal norms of what men and women should wear.