These may be extraordinarily dark times for the LGBTQ community in America, but a bright spot is on the horizon—and out of Mississippi, of all places. No, the state’s Republican-dominated legislature hasn’t wised up and repealed its horrific anti-LGBTQ segregation law. But a federal judge has agreed to consider a constitutional challenge to the legislation at a hearing next week. And here’s the really good part: The woman in charge of the challenge is Roberta Kaplan, whose track record of knocking down anti-LGBTQ laws in Mississippi is pretty damn stellar.

Kaplan launched her challenge to the Mississippi law, HB 1523, by questioning an especially troubling provision that allows clerks to refuse marriage licenses to same-sex couples while still issuing them to opposite-sex couples. When the state refused to cooperate with her requests for information, Kaplan reopened a previous case that had challenged Mississippi’s same-sex-marriage ban. That litigation ended with an injunction barring the state or its officers from discriminating against same-sex couples; Kaplan simply asked the judge, Carlton W. Reeves, to extend his previous order to prevent Mississippi’s clerks from turning away same-sex couples.

Now it appears the judge will do much more than that. In response to Reeves’ interest in the constitutionality of the entire law, Kaplan has filed a new brief to demonstrate that HB 1523 violates not just the due process and equal protection clauses, but also the establishment clause of the First Amendment. HB 1523, Kaplan explains in her motion to enjoin the law, singles out three religious beliefs for special protection: The belief that marriage is between a man and a woman, that sexual relations outside of such a marriage are improper, and that a person’s gender must be the same as they sex they were assigned at birth. The law then elevates these beliefs for special treatment, granting their holders a near-absolute right to discriminate against gay, bisexual, and trans people with regard to “marriage licenses, adoption and fertility services, access to health care, and public accommodation in restaurants, hotels, wedding halls, and more.”

“For these reasons,” Kaplan notes, “it is hard to imagine a clearer violation of the First Amendment than HB 1523.” The Supreme Court has long held, in accordance with the very explicit writings of the Framers, that government may not favor certain religions or religious beliefs over others. This endorsement of religion directly contravenes the Constitution’s command that no government may pass a law “respecting an establishment of religion.” By protecting only certain “preferred religious beliefs,” HB 1523 “creates special privileges” for a select group of believers to discriminate against LGBTQ Mississippians—which is forbidden under the First Amendment. By simultaneously endorsing certain religious beliefs and burdening those who don’t hold those beliefs, HB 1523 is more or less the quintessential example of an establishment clause violation.

Apparently, Mississippi did not consider this particular constitutional hitch in passing HB 1523, because the law’s legislative history is rife with bizarrely candid statements confirming the law’s very obviously unconstitutional intent. As Kaplan’s brief explains:

HB 1523’s sponsors and supporters have made it clear that the statute’s purpose is to extend benefits only to those who hold particular religious beliefs in order to promote and advance those beliefs and the sects that adhere to them, but no others. State Representative Dan Eubanks, a co-sponsor of HB 1523, for example, stated during floor debate that the bill was intended to protect “Christians” like him. Referring to same-sex relationships, Representative Eubanks said: “It’s very clear what God says. Go back and look at your Bible. He calls sin, ‘sin.’ ” Referring to his fellow Christians, Representative Eubanks said: “This [bill] is about aligning our right to worship, to speak, to do with our faith. And our faith is pretty clear.” Representative Eubanks closed by saying that HB 1523 “protects what I am willing to die for— and what I hope you who claim to be Christians are willing to die for—which is your beliefs.”

State Senator Jenifer Branning similarly acknowledged that although there are Mississippians with deeply held religious beliefs regarding gambling, the death penalty, and alcohol, HB 1523 does nothing to protect people who hold those religious beliefs because it is “very specific to same-sex marriage.” … When asked by Senator Willie Simmons whether refusing to employ gays and lesbians was a form of discrimination, Senator Branning replied, “If this bill is passed, it would not be.”

Moreover, the legislation was actually drafted in large part by the sectarian Christian lobbying organization Alliance Defending Freedom—which defines itself as a “Christ-Centered” “ministry” that fights to “[keep] the door open for the Gospel,” including opposing equal rights for gay and lesbian people and “redefining marriage.”

HB 1523, in other words, is an establishment clause nightmare, the kind of bill law professors might make up in a First Amendment seminar to illustrate the most obvious possible violation of church-state separation. Even Harvard Law School’s Noah Feldman—who leans conservative on church-state issues—vigorously agrees that HB 1523 is unconstitutional. “Don’t Let Mississippi Establish Anti-Gay Religion,” the headline of his most recent Bloomberg View piece reads. That about sums it up. With this bill, Mississippi didn’t just infringe on LGBTQ people’s fundamental rights; it also struck at the heart of the First Amendment. Good thing Kaplan is here to clean up this ridiculous mess.