Gov. Charlie Baker signed a law Friday that will allow transgender individuals to use the bathrooms, locker rooms and other facilities that correspond to their gender identities.

The bill comes after a negotiated compromise bill was enacted by legislators in both the State House and Senate that included language aimed at addressing safety concerns expressed by some critics.

That inclusion was seen as instrumental in securing Baker’s support for the bill, according to State House News.

“No one should be discriminated against in Massachusetts because of their gender identity,” Baker said in a press release about the signing.

One such security provision in the law instructs the state’s attorney general to develop guidelines that would allow a case to be brought against someone whose “assertion of gender identity is for an improper purpose.”

The law will go into effect on Oct. 1 -- one month after Attorney General Maura Healey’s mandate Sept. 1 deadline to  establish those guidelines.

The Massachusetts Commission Against Discrimination is also required to develop best practices to help businesses comply with the law, the Associated Press reported.