Schools Chancellor Richard Carranza’s crusade against “toxic” whiteness at the city Department of Education created an “Us vs. Them’’ culture that saw three longtime officials demoted in favor of less-qualified persons of color, a blockbuster $90 million lawsuit claims.

“If you draw a paycheck from DOE … get on board with my equity platform or leave,” Carranza thundered to employees assembled in the rotunda of the agency’s Lower Manhattan headquarters last June, according to the suit, filed Tuesday in state supreme court.

That “totalitarian threat” was just the most direct example of Carranza’s push to overhaul the leadership at the top and attitude throughout the DOE since he took the helm last year, claims the suit, levied against the department and Carranza by the trio of demoted white female executives.

“Under Carranza’s leadership, DOE has swiftly and irrevocably silenced, sidelined and punished plaintiffs and other Caucasian female DOE employees on the basis of their race, gender and unwillingness to accept their other colleagues’ hateful stereotypes about them,” wrote the group’s lawyer, Davida S. Perry, in the filing.

Plaintiff Lois Herrera, who started at the DOE in 1986 as a guidance counselor and worked her way up to lead its Office of Safety and Youth Development, claims in the suit that she saw a sea change almost immediately after Mayor Bill de Blasio appointed Carranza in April 2018.

A month later, LaShawn Robinson, then the executive director of the DOE’s Office of Equity and Access, purportedly told white attendees of a training seminar that they “had to take a step back and yield to colleagues of color” and “recognize that values of white culture are supremacist,” Herrera heard from a fellow administrator, according to the suit.

And that June, Carranza delivered his stay-or-go edict to address a flurry of recent staffing changes among department brass — including Robinson’s promotion to deputy chancellor of School Climate and Wellness.

At another scheduled event, in August, Herrera saw Robinson’s alleged attitude for herself.

“If you’ve been with the DOE for more than 20 years, you are responsible for the problem,” Robinson, who is black, allegedly said.

Robinson is not named as a defendant in the suit.

Despite being Harvard-educated and having been recognized as recently as 2017 for contributing to the “safest year on record” in city schools, Herrera was abruptly stripped of her title and demoted three levels “to essentially the bottom of the … group she formerly led,” the suit says.

Without so much as a formal search or interview process, Herrera was replaced by an African American man, Mark Rampersant, despite him being “demonstrably less qualified,” the suit claims.

Herrera said she was “required” to attend Rampersant’s promotion ceremony. Her repeated requests for a new workstation were met with her belongings being stuffed into boxes and stashed under a headquarters stairwell before she was ultimately transferred to the Bronx.

When Rampersant took Herrera’s spot, another plaintiff, Jaye Murray, the executive director of the Office of Counseling Support Programs, was told that she would now report to Rampersant, representing a demotion.

The only explanation Robinson purportedly gave Murray, who has been with the DOE since 2006, was that the department decided to go “in a different direction” — despite Murray’s own record of developing anti-bias workshops.

It wasn’t long before Murray was demoted another two rungs, ultimately settling below new OCSP head Gillian Smith, who “began a campaign to degrade” Murray by forcing her to report her work every 30 minutes, and, Murray would learn, going over her head and behind her back to direct Murray’s last two subordinates.

The third plaintiff, Laura Feijoo, claims that she was among the earliest casualties of Carranza’s overhaul.

When Carranza was appointing his first deputy chancellor, he tapped Cheryl Watson-Harris, who is black, over Feijoo, who is white and was Watson-Harris’ boss, without so much as interviewing Feijoo.

While Feijoo supervised all 46 other DOE superintendents, Watson-Harris didn’t even have the necessary license to be first deputy chancellor — so Carranza instituted a “transition period” so she could obtain it, the filing says.

Feijoo was not only leapfrogged by Watson-Harris but soon saw her underling replace her with Donald Conyers, who is black, and promote nine employees into a new role, “executive superintendent.”

Some of the nine had no prior superintendent experience. None was a white woman. All were now above Feijoo.

The three plaintiffs declined comment through their lawyer, Perry, who also represents a fourth female white DOE employee with similar claims who might still file a separate suit.

“As opposed to being assessed by their results or their actions, our clients were removed from their respective responsibilities and replaced by less qualified (or not qualified) individuals due to their gender and the color of their skin,” said Perry in a statement.

The Department of Education responded to The Post on Tuesday with the exact statement it gave two weeks ago when asked about the race issue.

“We hire the right people to get the job done for kids and families, and these claims of ‘reverse racism’ have no basis in fact,’ ’’ the department repeated.

Carranza declined to comment on the suit.