(CNN) Three months after being booed off the stage for a noncommittal stance on a bill protecting transgender people's rights in public places, Massachusetts Gov. Charlie Baker has signed compromise legislation.

The new anti-discrimination law , which was passed by the Massachusetts state House and Senate this week, gives transgender people the right to use public restrooms and locker rooms consistent with their gender identities, regardless of their sex at birth.

The Massachusetts Commission Against Discrimination (MCAD) will adopt policies to enforce its provisions, a statement from the governor's office said.

"No one should be discriminated against in Massachusetts because of their gender identity," Baker said after signing the bill Friday.

"This compromise legislation extends additional protections to the commonwealth's transgender community, and includes language to address the public safety concerns expressed by some by requiring the attorney general to issue regulations to protect against people abusing the law."

Read More