A new law that prevents public places from discriminating on the basis of gender has taken effect in Massachusetts today.

The new bill allows transgender people to use bathrooms and locker rooms that correspond with their gender identity.

Republican Governor Charlie Baker signed the law in July after several years of disagreement.

Advocates for the bill hope that trans people can no longer be discriminated against in public places.

Massachusetts Commission Against Discrimination and state Attorney General Maura Healey issued guidance on the law which instructs businesses to presume that a patron is using the appropriate bathroom or locker room unless there is a “compelling reason to seek proof of gender identity.”

Opponents of the bill collected over 30,000 signatures in an attempt to stop the law from passing. They argued it could put women and children at risk by allowing male sexual predators to claim gender identity as a pretence for entering bathrooms or locker rooms.

The repeal effort will not stop the law from going into effect for the time being. However, the law could be placed on a ballot in 2018.

Freedom Massachusetts fought for years to get the bill passed. They described the effort to prevent the law being passed as “harmful” but predict voters will keep the law if it reaches the ballot in two years time.

“We will not know until the signature verification process is complete whether this attempt to strip our Commonwealth’s transgender young people, adults and families of basic nondiscrimination protections has qualified for the 2018 ballot,” the group’s co-chairs, Kasey Suffredini and Mason Dunn, said in statement.

“What we do know is that this Saturday these critical protections go into effect statewide, ensuring that all Massachusetts residents will finally be free of discrimination in public places like restaurants and hospitals.”

Massachusetts has become the 18th state to pass a law that protects transgender peoples rights.

Boston has proposed an all-inclusive ID card that would not discriminate on the basis of gender identity, home status, or immigration status.