The referee who made a New Jersey high school wrestler cut his dreadlocks right before a match in order to be allowed to compete — a case that ignited debate over abuse of power and cultural bias — has been suspended from his position for two years, state officials announced Wednesday.

The punishment against Alan Maloney, who officiated the match last December, was reached between the state's Division on Civil Rights and the New Jersey State Interscholastic Athletic Association. In addition to Maloney being suspended for two wrestling seasons, officials and staff involved in high school athletics across New Jersey must participate in implicit bias training.

"Student athletes should be able to compete with each other on a level playing field," New Jersey Attorney General Gurbir Grewal said in a statement. "Racial discrimination in the enforcement of the rules of any sport is inconsistent with the spirit of fair play. The Division on Civil Rights' action today makes it less likely that any student athlete will have to endure discrimination that not only undermines fair competition but also violates our state laws."

Referee Alan Maloney forced high school wrestler Andrew Johnson to cut his dreadlocks during a match. NJ Advance Media

The Division on Civil Rights also issued guidance on how racial discrimination can be based on one's hairstyle, which it says occurs when certain physical traits, like hair, are "inextricably intertwined with or closely associated with race." The guidance clarifies that banning or restricting hairstyles that are associated with black people or those with black ancestry, including dreadlocks and twists, may violate New Jersey law.

Officials with the state athletics association said the new rules will help "ensure that a situation like this does not happen in the future."

The state opened its civil rights investigation after the match involving Andrew Johnson, a biracial athlete from Buena Regional High School in Atlantic County, went viral — an incident viewed millions of times and leading to accusations of racism.

Maloney, who is white, had told Johnson that his hair and headgear did not comply with rules, and that if he wanted to compete, he would have to immediately cut his dreadlocks — or forfeit. Johnson agreed to a haircut in the moments just before competing.

Maloney, who was once accused of calling another referee a racial slur during a March 2016 social gathering, was suspended pending the outcome of the state investigation. He could not immediately be reached for comment Wednesday.

In a legal filing in March signaling that he may sue for defamation and "emotional distress," Maloney said he "properly performed his duties as the referee and fairly applied the rules governing a wrestling match."

The initial incident in December was condemned by New Jersey Gov. Phil Murphy, Olympic wrestler Jordan Burroughs and film director Ava DuVernay, among others.