On Wednesday night, in the course of just a few hours, North Carolina became the most anti-LGBTQ state in the country.

In a special session called for exactly this purpose—and which cost taxpayers $42,000 a day—the legislature passed a stunningly vicious, completely unprecedented bill stripping LGBTQ North Carolinians of their rights. The measure revokes local gay and trans nondiscrimination ordinances throughout the state, effectively legalizing anti-LGBTQ discrimination, and forbids trans people from using the bathroom that aligns with their gender identity. That includes trans public school students, many of whom will now, in effect, be barred from using the bathroom at school.

Shortly after the legislature passed the bill—over the objections of every Senate Democrat, all of whom walked out of the chamber in protest—Republican Gov. Pat McCrory signed it into law. Explaining that he was eager to nullify Charlotte’s new LGBT nondiscrimination measure, McCrory wrote, “The basic expectation of privacy in the most personal of settings, a restroom or locker room, for each gender was violated by government overreach and intrusion by the mayor and city council of Charlotte.”

McCrory should know something about government overreach. The gallingly cruel bill he just signed doesn’t just transgress basic norms of decency and morality. It also violates federal law and the U.S. Constitution.

As interpreted by the Department of Education, Title IX of the Education Amendments of 1972 forbids discrimination against trans students in any school that receives federal funding. These schools are prohibited from excluding trans students from the bathroom consistent with their gender identity. The new North Carolina law, dubbed H2, rebukes this federal mandate by forbidding public schools from allowing trans students to use the correct bathroom. That jeopardizes the more than $4.5 billion in federal education funding that North Carolina expected to receive in 2016. Without that money, many schools in the state—from kindergarten through college—will be unable to function. McCrory should prepare to explain to North Carolina parents why their children’s access to education is less important than degrading and demeaning trans students on account of their identity.

HB 2 is also unconstitutional—not maybe unconstitutional, or unconstitutional-before-the-right-judge, but in total contravention of established Supreme Court precedent. In fact, the court dealt with a very similar law in 1996’s Romer v. Evans, when it invalidated a Colorado measure that forbade municipalities from passing gay nondiscrimination ordinances. As the court explained in Romer, the Equal Protection Clause forbids a state from “singl[ing] out a certain class of citizens” and “impos[ing] a special disability upon those persons alone.” Such a law is “inexplicable by anything but animus toward the class it affects,” and under the 14th Amendment, “animosity” toward a “politically unpopular group” is not a “proper legislative end.” Just like the law invalidated in Romer, HB 2 “identifies persons by a single trait”—gay or trans identity—“and then denies them protection across the board.” The Equal Protection Clause cannot tolerate this “bare desire to harm” minorities.

HB 2 classifies and targets trans people on its face, rendering its anti-trans provisions immediately susceptible to Romer scrutiny. (Legislators justified this assault by claiming that trans nondiscrimination laws permit sexual predators to attack women in bathrooms, but this is pure and proven fiction, which cannot pass even lenient judicial review.) The law’s attack on gays and bisexuals, however, is slightly subtler. Instead of naming sexual minorities, the law bars municipalities from passing nondiscrimination laws that extend beyond the statewide standards—which, of course, do not forbid sexual orientation (or gender identity) discrimination. So, in practice, no city can legally protect its LGBT residents.

This artful workaround cannot save the rest of the bill. Under Arlington Heights v. Metropolitan, courts must attempt to glean whether a law with a disparate impact on minorities was motivated by discriminatory intent. To do so, courts examine several factors—all of which align chillingly with HB 2. For example, does the challenged law disproportionately affect one minority? (Yes.) Does the “historical background” reveal “a series of official actions taken for invidious purposes”? (Yes—the stated purpose of the law was to overturn Charlotte’s LGBT nondiscrimination ordinance.) Do the events leading up to the law depart from normal decision-making procedures? (Yes; the legislature rammed the law through in record time with minimal discussion.) Does the legislative history reveal governmental animus? (Absolutely: From the start, Republican legislators have vocally supported HB 2 as an effort to disadvantage LGBT people.)

And even if a court were somehow not convinced that HB 2 runs afoul of Arlington Heights, another, even more venerable precedent controls: 1967’s Reitman v. Mulkey, whose continued vitality the Supreme Court recently reaffirmed. In Mulkey, the court confronted a purportedly neutral California law that prohibited any legislative interference with property owners’ right to refuse to sell or rent their property for any reason. The court rightly noted that even though the law did not explicitly mention discrimination, its “immediate design and intent” was to establish a “right to privately discriminate” in a manner that directly harmed minorities. Thus, the law’s efforts to leave discrimination as its subtext could not save it from crashing into the shoals of the Equal Protection Clause.

HB 2 is Mulkey redux. Actually, it is Mulkey combined with Arlington Heights, cast through the lens of Romer, refracted through the prism of Obergefell v. Hodges. In short, it is blatantly and brazenly unconstitutional, an appalling attempt to humiliate LGBT people, exclude them from the political process, and impose special burdens on their everyday lives. It cannot survive constitutional scrutiny, and it barely even pretends to be motivated by anything more than a desire to harm politically unpopular minorities. Such legislation is an affront to the Equal Protection Clause and to America’s constitutional tradition. One hundred and twenty years ago, Justice John Marshall Harlan wrote that our Constitution “neither knows nor tolerates classes among citizens.” On Wednesday, North Carolina created a new class, a lesser class, among its citizens. It is now up to the courts to remind the state of Harlan’s other admonition: “In respect of civil rights, all citizens are equal before the law.”