The Massachusetts State House passed a historic bill Wednesday banning discrimination in the state on the basis of gender identity -- including in bathrooms.

The House voted 116-36 in favor of the bill, which bars discrimination against transgender people in public accommodations, and allows them to use public facilities that correspond to their gender identity. Twelve Democrats reportedly opposed the bill, while eight Republicans supported it.

The Senate passed a similar bill last month in a 33-4 vote, with Gov. Charlie Baker saying he’d sign the house bill after “hearing from all sides,” according to State House News Service.

“The vote capped a long journey for proponents of the bill who were unsuccessful in advancing the legislation over an eight-year period when the State House was entirely controlled by Democrats,” the news service observed.

The House rejected amendments that would have exempted legally sex-segregated facilities, bathrooms and locker rooms used primarily by minors, and group showers in locker rooms, according to the report. Efforts to ban level 2 and level 3 sex offenders from these protections also failed.