Ontario has become the first province in Canada to recognize gender identity in its human rights legislation.

An amendment to the Ontario Human Rights Code prohibiting discrimination against transgender people was passed in the legislature on Wednesday.

Minutes after the amendment passed, the lobby outside the legislature was filled with transgender people, hugging and shaking hands with MPPs.

Christine Elliott, deputy leader of the Opposition Progressive Conservatives said the new law will "prevent discrimination against anyone in Ontario."

In a rare show of unity the bill, which was supported by all three parties in the legislature, passed unanimously.

"I'm just happy that now people have that tool to fight the oppression that our community faces so much," said Luka Sidaravicius.

Transgender people say they frequently struggle to find jobs, rental housing, sometimes even health services.

"It's just wonderful to see our rights recognized for the first time," said Christin Milloy grew up in Mississauga, just west of Toronto.

"I had a family who loved and accepted me, I'm so grateful for that. So many trans people don't have that."

The amendment was introduced as a private members' bill by NDP MPP Cheri DiNovo.

"To me it's homage to a dear, dear friend who was lost — as many transgendered folk are lost — to suicide," she said.

DiNovo said the amendment will do more than just help transgender people be accepted.

"It will change a great inequity that has been in place forever," she said.