Accusations of racial bias are being made after a high school wrestler in New Jersey was forced by a referee to cut off his dreadlocks or forfeit his match.

Buena Regional High School wrestler Andrew Johnson, who is black, was told he could not compete with long hair at a meet in Atlantic County on Wednesday. Johnson was wearing his usual headgear and covering, but the referee said it was not in compliance with rules by the New Jersey State Interscholastic Athletic Association (NJSIAA).

Visibly distraught and being comforted by teammates and coaches, Johnson had his dreadlocks sheared off by a trainer. He returned to the mat and ended up winning his match.

The NJSIAA and the New Jersey Division on Civil Rights (DCR), a department in the state's attorney general's office, have both launched investigations into the incident.

"DCR generally becomes involved only if the matter is not properly investigated or remedied by that initial investigation," Sharon Lauchaire, director of communications for the Office of the Attorney General, said in a statement provided to ABC News Friday. "DCR was notified this afternoon of an incident involving an NJSIAA official and a wrestler from Buena High School. Because the incident involved an NJSIAA official, DCR has opened an investigation."

New Jersey Gov. Phil Murphy tweeted Saturday that "no student should have to needlessly choose between his or her identity & playing sports."

The referee, identified by Philadelphia ABC station WPVI as Alan Maloney, will continue to be allowed to referee as an investigation into the incident continues, but he won't oversee any Buena Regional High School matches, according to the school district.

"The Superintendent of the Buena Regional High School District spoke with the NJSIAA Assistant Director and stipulated that, although the investigation into the matter is ongoing, the assigned referee will no longer be permitted to officiate any contests that include any Buena Regional School District student-athletes," Buena Regional School District Superintendent of Schools David Cappuccio Jr. wrote in a letter addressed to "community members and concerned citizens."

Johnson's act of cutting off his dreadlocks right beside the mat was captured in a video which has now spread across the internet and garnered widespread anger. The video of Johnson having his hair cut by a trainer was first shared on Twitter by SNJ Today Sports Director Mike Frankel. The video had 8.97 million views as of early Saturday.

Frankel called Johnson the "epitome of a team player" in his tweet.

The rule states, "If an individual has hair longer than allowed it must be contained in a legal hair cover that is attached to the ear guards. The wrestler opting to wear a legal hair cover must wear it to the weigh-in procedure."

Johnson not only had his cover on but if he was breaking any rules, he should have been told that before ever stepping on the mat, said wrestler Jordan Burroughs, an Olympic gold medalist.

"As a referee, the rule book always says that the referee is supposed to go in for a briefing with both teams that are competing about an hour before the duel," Burroughs, who said he did not speak to Johnson directly, told ABC News.

"He lays the ground rules of what's going to happen, his style of refereeing and then he also checks each wrestler on each team to make sure they're in accordance with whatever rules would apply when they're out on the mat. ... Personally, I think this situation should have been addressed way before these guys ever reached the mat."

"I have heard of people that have had to cut their hair in the past, but never on the mat and it's never been a young man with dreads," he added. "In this particular case, I think that for me the instance is magnified because of how closely related to culture and identity dreadlocks are. I know how long they take to grow, how much discipline it takes to maintain them and how much a cultural identity is implicated when you have something like this [happen]."

Maloney, who is white, has a history of racism, according to WPVI. Maloney was accused of using the N-word by a black referee at a referee get-together in 2016.

Maloney did not respond to a request for comment from ABC News.

"His hair has always been like that, so for them to now bring it up is out of line," Johnson's classmate, Maylin Bauza, told WPVI.

ABC News' Kate Hodgson, Rachel Katz, Courtney Han and Leonardo Mayorga contributed to this report.