Days after it passed through the Legislature with heavy support, a bill to prohibit discrimination based on hairstyles historically associated with race was signed into law.

Gov. Phil Murphy signed the measure, S-3945/A-5564, late Thursday, he announced, "in order to help ensure that all New Jersey residents can go to work, school, or participate in athletic events with dignity."

"No one should be made to feel uncomfortable or be discriminated against because of their natural hair," Murphy said in a statement.

The "Create a Respectful and Open Workspace for Natural Hair Act" or CROWN Act prohibits discrimination on the basis of a hairstyle, type or texture that is attributed with race and amends the Law Against Discrimination accordingly. Hairstyles named specifically in the legislation are braids, locks and twists.

The effect of the legislation, New Jersey Division on Civil Rights director Rachel Wainer Apter said in a statement, is: "Employers, housing providers, and places open to the public, including schools, cannot police natural black hairstyles."

A primary sponsor of the measure, Sen. Sandra Cunningham, D-Hudson, said in a statement that she is "proud to see New Jersey become just the third state in the nation to put an end to this discriminatory practice."

New York and California also have passed such a law.

"This law will ensure people of color are free to wear their hair however they feel best represents them, whether that be locks, braids, twists or curls. No one should ever be told it is 'unprofessional' to embrace their culture," Cunningham added.

The legislation was prompted by the case of Buena Regional High School junior Andrew Johnson, who a year ago was told by a referee that he must shave off his dreadlocks in order to participate in a wrestling meet, or else forfeit. Video of the incident became a national story. In addition to the legislation, the incident led to suspension of the meet's referee and the issuance three months ago of the state's "Guidance on Race Discrimination Based on Hairstyle."