A bill that seeks to prohibit therapies that attempt to alter the sexual orientation or gender identity of lesbian, gay, bisexual or transgender people cleared Canada's Senate on Tuesday.

Such therapies go by names such as “conversion therapy,” “reparative therapy,” “sexual orientation change efforts” or “ex-gay therapy.”

According to CTV News, senators voted unanimously in favor of the bill, which cleared the House of Commons on Wednesday. The bill will become law once it receives royal assent.

Similar state bills in the United States primarily protect LGBT youth. Canada's law, however, also includes adults.

The legislation “proposes to outright prohibit both adults and children from being subjected to harmful conversion therapy practices, through four new Criminal Code offenses including making it a crime punishable by up to five years in prison to cause another person to undergo conversion therapy,” CTV News reported.

Two similar bills over the last few years have failed to become law.

Prime Minister Justin Trudeau tweeted his thanks.

“Our government’s legislation to ban conversion therapy in Canada is one step closer to becoming law,” Trudeau said. “To everyone who has made this possible, thank you. Let’s keep building a country where everyone is free to be who they are and love who they love.”