Republican Gov. Charlie Baker said Tuesday he would sign a bill banning discrimination against transgender people in public accommodations, provided the final version includes language that targets false claims of gender identity.

For months, Baker had avoided a commitment to sign the bill, which among other things would allow people to use restrooms and locker rooms that correspond to their gender identity. The governor had repeatedly said he would review the legislation if and when it reached his desk.

“No one should be discriminated against in Massachusetts because of their gender identity,” Baker said in a statement. “After hearing from all sides and carefully reviewing the two separate proposals that have been working their way through the legislature, I believe the House version addresses the concerns that some have with the bill by requiring the Attorney General to issue regulations to protect against people abusing the law.”

The language in the House bill — scheduled for debate on Wednesday — calls for penalties against anyone who makes an “improper” claim of gender identity.

Critics of the legislation have argued that a sexual predator could falsely claim to identify as a woman to gain access to female bathrooms or locker rooms. Supporters of the bill have called such fears unfounded.

The state Senate approved a bill earlier this month that does not include the language regarding improper use of gender identity.

The transgender rights group Freedom Massachusetts said it’s “thrilled” by the announcement Tuesday from Baker, who in April was booed off a stage while delivering a speech to members of the LGBT community after refusing to commit to signing the bill.

“His statement underscores that this is not a partisan issue,” said Carly Burton, the group’s campaign manager.

The issue has stirred controversy in other states including North Carolina, which recently passed a law that would require transgender people to use public bathrooms that correspond to the gender listed on their birth certificates. The U.S. Justice Department has warned that the North Carolina law violates civil rights protections.

Seventeen states and the District of Columbia have laws that bar discrimination against transgender people in public accommodations.

Democrats who hold a wide majority in the Massachusetts House met in a closed-door caucus on Tuesday to discuss the bill. Speaker Robert DeLeo later said he expects the measure to pass, but he will not be satisfied until it becomes state law.

“I’m not looking to get up there and pass a piece of legislation, feel good about it, say ‘rah rah and look what we’ve done,’ and not have it passed into law,” said DeLeo, a Winthrop Democrat.

Rep. John Fernandes, House chairman of the Judiciary Committee, said he reassured lawmakers during the caucus that no serious incidents had occurred in states that have adopted public accommodations laws.

“This has not been a problem implementing in other states,” he said, “It’s a very emotional issue and so it’s one that with information you can make a more rational decision.”

House Republicans have proposed several amendments to the bill, including ones that would create exceptions for restrooms and locker rooms primarily used by children, and to exclude registered sex offenders from the anti-discrimination provisions.

Democratic Senate President Stan Rosenberg has said he considers the House provision related to improper use of gender identity to be unnecessary, yet not harmful to the bill either.

If the House passes the bill, the Senate would then have the option of concurring with the House language or sending the bill to a House-Senate conference committee to resolve differences between the two versions.

(Copyright (c) 2024 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)

Join our Newsletter for the latest news right to your inbox