The bill, approved on a 32-15 vote, would prevent discrimination on matters relating to housing, employment, credit and use of public accommodations such as hotels and restaurants.

The measure defines gender identity as the gender-related identity, appearance, expression or behavior of a person, regardless of the person's assigned sex at birth. In the legislation, gender identity can be demonstrated by "consistent and uniform assertion of the person's gender identity or any other evidence that the gender identity is sincerely held as part of the person's core identity."

There were 31 Democrats who voted for the bill and one Republican. Eleven Republicans opposed the bill, along with four Democrats.

Sen. Bryan Simonaire, an Anne Arundel County Republican who voted against the bill, questioned how the measure would affect the use of public restrooms. Sen. Jamie Raskin, a Montgomery County Democrat who supported the measure, said people would be able to use the restroom for the gender they consistently have identified themselves as being. Raskin also noted that Montgomery, Baltimore and Howard Counties, as well as the city of Baltimore, already have protections in place for people who are transgender.

"This has not been a problem in any place where we have it, so they basically have continued to have the men's room and the women's room, and the transgender people go to the place that's consistent with their gender identity," Raskin said.

Raskin also said that gyms often have a third place for people to change in addition to the men's and women's rooms.

Sen. Allan Kittleman, who was the only Republican to vote for the bill, said Howard County has had the policy in place for three years, and he has not heard of any complaints.

"I worry that people will think these terrible things are going to happen when they really aren't," Kittleman said.

The measure also prohibits an employer from requiring an employee to dress or groom in a certain way, so long as an employee can dress or groom in a manger consistent with the employee's gender identity.