Updated July 26 at 5:47 p.m.

It is now illegal in Massachusetts to discriminate against someone based on their hair texture or style.

Gov. Charlie Baker on Tuesday signed into law a bill that protects people with natural hairstyles — including braids, locks, twists and other protective styles — against discrimination in public schools, workplaces and public spaces.

This law is slightly different from bills the state House and Senate passed in the spring. The Senate wanted to extend discrimination protections to religious schools and private school athletes, but the final bill the two chambers agreed upon does not apply to those institutions.

The original Senate bill was introduced back in March by Assistant Majority Leader Sen. Sal N. DiDomenico.

“We were inspired by these two sisters at Mystic Valley Charter School who had to go through that unfortunate situation and be discriminated against by their own school,” he said.

In April 2017, sisters Mya and Deanna Cook, two Black 15-year-old students at Mystic Valley Regional Charter School, were ordered by school administrators to remove their braid extensions as these violated the school’s hair and makeup policy. Following this, the school imposed detention and threatened to suspend the sisters from the institution. An outpouring of support and legal action followed.

“[These policies are] a proxy for race,” said state Sen. Lydia Edwards. “This is just an extension of the many ways in which racism and discrimination has extended itself.”

For Edwards, who is currently Massachusetts' only Black senator, this issue is not only one for equality but also a personal one.

“I’ve been through the ups and downs in the journey with my own hair,” she said. “I was putting in so much money making my hair what it wasn’t, because I thought it was what was professional.”

On the other hand, Sen. DiDomenico expressed his happiness to pass the anti-discrimination bill, but also expressed his incredulity for the need to pass one.

“It seems crazy that we even have to pass a bill to address this issue. To make sure that young people and people in the workplace are not discriminated against based on their natural hairstyle,” DiDomenico said.

DiDomenico said he was happy for the Cook sisters.

“They inspired this bill and they were part of the process of getting it filed,” DiDomenico said, adding that he was glad they could see "all they had to go through wasn't in vain.”

This story was updated after Gov. Baker signed the bill into law.