A compromise struck by Massachusetts state legislators Wednesday aimed at combining a House and Senate version of atransgender rights bill was approved by the two bodies Thursday.

The approved law wouldallow transgender individuals to use the bathrooms that correspond to their gender identity, as well as banning discrimination in public accommodations like pools and restaurants.