Thailand’s lawmakers passed a legislation to recognize same-sex marriage, paving the way for the country to become the first in Southeast Asia to guarantee marriage rights for gay and lesbian couples.

The 500-member House of Representatives voted to pass the so-called marriage equality bill, technically an amendment to the Civil and Commercial Code, in a final reading on Wednesday. As many as 400 lawmakers backed the legislation, while 10 opposed it and five members either abstained or didn’t vote, after more than three hours of debate.

The bill now heads to the upper-house Senate, which is set to review it on April 2. It will then be endorsed by the King and published in the Royal Gazette. The amendments will take effect 120 days later.