Thailand is poised to become the first country in Southeast Asia to legalize same-sex marriage after lawmakers voted to approve a marriage equality bill.

The historic bill was passed by the country’s senate Tuesday after it cleared the House of Representatives in March. To become law, it needs the endorsement of the country’s king, which it is widely expected to receive.

That will make Thailand the third place in Asia, after Taiwan and Nepal, to legally recognize same-sex marriages.

The Thai bill also gives same-sex couples equal rights to adopt children and inherit property. It “changes the legal landscape quite significantly,” said Chanatip Tatiyakaroonwong, Thailand researcher for human-rights group Amnesty International.

He said that in recent years, LGBT concerns had been raised prominently in broader political protests in Thailand, helping to boost the profile of the issues among a wider segment of society. “We definitely hope that this development will send a positive signal across the region,” he said.

Taiwan became the first place in Asia to recognize gay marriage in 2019. Nepal began registering same-sex marriages last year.

But the marriage equality movement has seen slow progress in other parts of the region. India’s Supreme Court decriminalized gay sex in 2018 but declined last year to extend marriage rights to LGBTQ people. It said regulating marriage was the domain of lawmakers.

Singapore last year scrapped an unenforced law that criminalized sex between men. At the same time, it moved to safeguard the definition of marriage as being between a man and a woman.

In Indonesia, lawmakers approved a bill in 2022 that bans sex outside of marriage, effectively banning homosexual sex, as same-sex marriage isn’t recognized in the country.

In a Pew Research Center study last year, 60% of people surveyed in Thailand said they supported the rights of gay people and lesbians to marry legally, just a nudge behind the 63% of Americans who said the same. Prime Minister Srettha Thavisin joined the Bangkok Pride Parade earlier this month and waved a rainbow flag. “We have come far in our journey towards social equality,” he tweeted at that time.

“Thailand’s new marriage equality law is a triumph for justice and human rights,” said Mookdapa Yangyuenpradorn of the human-rights advocacy group, Fortify Rights. “The journey to this point has been long and fraught with challenges, but today’s vote to ensure marriage equality marks a historic moment that deserves celebration.”

Write to Jon Emont at jonathan.emont@wsj.com