BANGKOK (AP) — Singapore announced Sunday it will decriminalize sex between men by repealing a colonial-era law while protecting the city-state’s definition of marriage.

During his speech at the annual National Day Rally, Prime Minister Lee Hsien Loong said he believed it is the “right thing to do now” as most Singaporeans will now accept it.

“This will bring the law into line with current social models and I hope provide some relief to gay Singaporeans,” Prime Minister Lee Hsien Loong said during his speech at the annual National Day Rally.

He said the government will also amend the Constitution to ensure that there can be no constitutional challenge to allow same-sex marriage.

“Even as we repeal Section 377A, we will uphold and safeguard the institution of marriage,” Lee said. “We have to amend the Constitution to protect it. And we will do so. This will help us repeal Section 377A in a controlled and careful way.”