Taiwan has become the first parliament in Asia to legalise same-sex marriage, as it shot down last-minute objections from conservative politicians to approve the change in a vote on Friday.

The constitutional court had given parliament two years to come up with legislation on same-sex marriage, after ruling that gay couples had the right to legally marry.

But matters were complicated by a series of referendums in November in which voters convincingly rejected defining marriage as anything other than a union between a man and a woman.

Three possible bills were debated, including two by conservative groups that referred to same-sex “civil-unions” or “family relationships” rather than marriage. These were rejected, and the most progressive of the three was passed.

The successful bill includes limited adoption rights for same-sex couples. It was tabled by the government and begrudgingly backed by gay rights campaigners, who see it as falling short of full equality but at least a step in the right direction.

Best pictures from the 2018 Taipei Gay Pride March in Taiwan Show all 35 1 /35 Best pictures from the 2018 Taipei Gay Pride March in Taiwan Best pictures from the 2018 Taipei Gay Pride March in Taiwan Participants take part in the 2018 Taipei Gay Pride March in Taipei, Taiwan, 27 October 2018. AFP/Getty Images Best pictures from the 2018 Taipei Gay Pride March in Taiwan Thousands of people attended the march in Taipei, the capital of Taiwan. REUTERS Best pictures from the 2018 Taipei Gay Pride March in Taiwan Participants walk in the parade. REUTERS Best pictures from the 2018 Taipei Gay Pride March in Taiwan The march took place ahead of a landmark vote next month on LGBT+ rights in Taiwan. REUTERS Best pictures from the 2018 Taipei Gay Pride March in Taiwan On May 24 2017, the Constitutional Court in Taiwan ruled that same-sex couples have the right to marry in the state. AP Best pictures from the 2018 Taipei Gay Pride March in Taiwan After making its ruling on same-sex marriage in May last year, the court stated that its decision must be implemented in two years. AP Best pictures from the 2018 Taipei Gay Pride March in Taiwan On November 24, a public vote will be held in Taiwan on same-sex marriage. AFP/Getty Images Best pictures from the 2018 Taipei Gay Pride March in Taiwan A participant of the march poses next to a wedding studio. REUTERS Best pictures from the 2018 Taipei Gay Pride March in Taiwan A young woman from Chongqing in mainland China holds a fan reading "free writers" before the start of the march. AFP/Getty Images Best pictures from the 2018 Taipei Gay Pride March in Taiwan Participants with Pikachu-styled costumes pose as they gather at the square outside the presidential office for the start of the march. AFP/Getty Images Best pictures from the 2018 Taipei Gay Pride March in Taiwan Thousands took part in the parade in support of same-sex marriage. REUTERS Best pictures from the 2018 Taipei Gay Pride March in Taiwan Participants in the square outside the presidential office before the start of the parade. AFP/Getty Images Best pictures from the 2018 Taipei Gay Pride March in Taiwan A couple take part in the march with their baby. AFP/Getty Images Best pictures from the 2018 Taipei Gay Pride March in Taiwan Members of Tokyo Rainbow Pride walk in the parade. AFP/Getty Images Best pictures from the 2018 Taipei Gay Pride March in Taiwan The parade was awash with rainbow-coloured paraphernalia. AFP/Getty Images Best pictures from the 2018 Taipei Gay Pride March in Taiwan A participant of the march poses with a fan. AP Best pictures from the 2018 Taipei Gay Pride March in Taiwan A participant from Japan holds a banner before the start of the march. AFP/Getty Images Best pictures from the 2018 Taipei Gay Pride March in Taiwan Young women display rainbow flags. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan A person taking part in the march waves a rainbow flag. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan A man, decorated with balloons and a rainbow flag, takes part in the celebrations. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan An American man and his Japanese partner, both wearing headbands saying 'Japan' in Japanese, kiss each other during the march. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan Thousands of people attended the annual march. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan Taiwan gay rights activist Chi Chia-wei attends the march. Chi became the first person in Taiwan to come out as gay on national television in 1986. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan Participants take part in the march, organised by Taiwan LGBT Pride. AP Best pictures from the 2018 Taipei Gay Pride March in Taiwan Participants hold up a large rainbow flag. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan People walking in the parade. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan A person stands in front of a rainbow-coloured flag. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan A Japanese couple hold a sign saying 'You Are My Safe Harbour' in Chinese. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan A man, decorated with balloons and rainbow flags, takes part in the march. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan The first Taiwan Pride march was held in 2003. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan Participants display a huge rainbow flag during the 2018 Taipei Gay Pride March. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan Two men take a selfie in front of a rainbow flag. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan A man waves a rainbow flag during the march. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan The annual Taipei Gay Pride March is the largest in East Asia. EPA Best pictures from the 2018 Taipei Gay Pride March in Taiwan The Rainbow City Symphonic Band performs during the march. EPA

Thousands of gay rights supporters gathered outside parliament in Taipei on Friday during the debate, awaiting the landmark vote.

And fighting through the heavy rain, demonstrators embraced tearfully and celebrated with chants of “Asia’s first,” and “Way to go, Taiwan!”

President Tsai Ing-wen – whose party holds the majority in parliament – recognised the issue had been divisive but said in a Facebook post that the government’s bill was the only option to respect both the court ruling and the referendum.

She wrote on Twitter on Friday morning: ”Today, we have a chance to make history and show the world that progressive values can take root in an East Asian society.”

Friday’s measure could prove a challenge to Tsai’s bid for a second term in a January presidential election, after a poll defeat last year for her DPP was blamed partly on criticism of her reform agenda, including marriage equality.

“The will of some seven million people in the referendum has been trampled,” one conservative group, the Coalition for the Happiness of Our Next Generation said in a statement. “The massive public will strike back in 2020.”