Growing up transgender, Brandon Adams told a packed State House hearing room Tuesday, he’s faced bullying in school and online.

The 14-year-old said he felt afraid to use the boys bathroom at school and risk being attacked. His former school, a charter school in Framingham, instead offered him a separate staff bathroom, he said, which he called “segregated.”

“I asked to use the boys bathroom because that’s where I felt safe. Because that’s who I am: I’m a boy. I was told ‘no,’ because of the fact that my anatomy was not male,” he said.

Adams was one of many to testify at the State House on Tuesday at a hearing for legislation that would extend a 2011 equal rights law by adding protections for transgender people in public spaces.

RELATED: Boston Police issue new transgender guidelines

“I look to you, my representatives, to focus and support in any way you can. Make all kids feel safe and secure and let them focus on being kids. Kids should be thinking about their first date or getting their drivers’ license, not living in fear,” Adams said.

The bill had sparked concern from opponents about children having to encounter transgender people in bathrooms — for example a person who identifies as a woman, but was born as a man, sharing a restroom with a young girl.

Speaking at Tuesday’s hearing, Rep. James Lyons called up those criticisms, also arguing that state law already provides enough protection for trans people making discrimination claims.

“I’m suggesting that the privacy rights of our children matter,” said State Rep. James J. Lyons, an Andover Republican, to applause. “We ought to at least think about that.”

RELATED: Video: Hillary Clinton talks LGBT rights

Attorney General Maura Healey, a Democrat, said her office received seven discrimination complaints from trans people this year.

State law, Healey said, does not give the transgender community enough power to press claims against restaurants, hospitals, businesses or others they feel have not treated them fairly.

“It does not make sense to me that a restaurant can’t refuse to hire a transgender person, but could refuse that same person service when they walk in for a meal,” she said.

U.S Rep. Joe Kennedy III, a Democrat, made a special appearance, accompanying the 14-year-old Adams, as well as two moms with transgender children.

He pointed out that 17 other states already provide similar protections for transgender people.

Sara Reid of Salem.

Sara Reid of Salem.

“We are known for pushing our country, so it means something when we don’t,” Kennedy said.

Before the hearing, Sara Reid of Salem said she had faced unequal treatment from employers due to her gender identity and had friends in the trans community who had been denied apartments and harassed in public.

RELATED: Photos: 12 famous transgender celebrities and public figures you should know

“I’ve experienced it myself,” Reid told Metro. “I just feel [the bill] gets a message to people in the state that this is not the kind of people we are in Massachusetts.”

Several other state and local leaders voiced support for the legislation, among them Boston Police Commissioner William Evans and Suffolk County District Attorney Dan Conley.

Gov. Charlie Baker, a Republican, this week told reporters he would not commit to supporting the bill.

“I think we should never discriminate against anybody,” he said, adding, “the devil’s always in the details.”