Gov. Charlie Baker was heckled and booed at an LGBT event Wednesday night when he failed to commit to legislation that would protect the rights of transgender people in public spaces.

Baker's speech to hundreds of people at the 10th Annual Boston Spirit LGBT Executive Networking Night ended early when he walked off the stage and he did not mingle with the crowd after, as organizers had hoped.

Here's video from an attendee of the speech:

In his remarks, Baker decried any form of discrimination, but when he said he would "talk to all parties involved" if the legislation reaches his desk, people in the crowd started chanting "sign the bill."

Attendee Lorelei Erisis told The Boston Herald it was a "politically tone-deaf" speech."

A spokeswoman says the Republican governor looks forward to reviewing the bill should it reach his desk.

The legislation seeks to prohibit discrimination against transgender people in public accommodations -- restaurants, lodging, gender-segregated changing rooms and restrooms. It extends protections signed into law in 2011 in the areas of housing and employment.

Earlier Wednesday, Senate President Stan Rosenberg, an Amherst Democrat, said the Senate plans to debate the bill "probably in May."

An opponent of the legislation, Jonathan Alexandre, legal counsel for the Massachusetts Family Institute, told WBUR earlier this month that "the Legislature has a responsibility to protect the rights and privacy of women and children in public restrooms, showers and locker rooms."

With reporting by The Associated Press and the WBUR Newsroom

Correction: An earlier version of this report misstated the order of events at the Wednesday event, and when crowd chanting began. We regret the error.