On Wednesday, the 6th U.S. Circuit Court of Appeals ruled that Title VII of the Civil Rights Act of 1964 prohibits employment discrimination against transgender people. It also held that employers may not use the Religious Freedom Restoration Act to justify discrimination against LGBTQ workers. The court’s landmark decision is an emphatic rejection of the legal theory that businesses may fire or mistreat female and minority workers under the guise of religious liberty. It also affirms the growing judicial consensus that existing civil rights law protects LGBTQ employees.

Wednesday’s case, EEOC v. R.G. & G.R. Harris Funeral Homes, centers around Aimee Stephens, a transgender woman who worked as a funeral director. When she started the job, Stephens presented as male, the sex she was assigned at birth. But in 2013, she told her boss, Thomas Rost, that she had a gender identity disorder and planned to transition. Rost promptly fired her. He later testified that he terminated Stephens because “he was no longer going to represent himself as a man,” and Rost believes that gender transition “violat[es] God’s commands” because “a person’s sex is an immutable God-given fit.”

The Equal Employment Opportunity Commission sued on Stephens’ behalf, alleging unlawful sex discrimination under Title VII. (Stephens eventually secured representation from the ACLU as well.) A district court ruled that Stephens had suffered sex discrimination—not because she was transgender, per se, but because she was subjected to impermissible sex stereotypes. But the court then held that her employer had a right to fire her under the Religious Freedom Restoration Act, or RFRA. The funeral home is not actually affiliated with any religious institution. But the court found that the RFRA permits private employers to discriminate against workers when their personal religious beliefs compel them to do so.

This, the 6th Circuit explained in an opinion by Judge Karen Nelson Moore, cannot be right. First, she held that Title VII does outlaw anti-trans employment discrimination, for two independent reasons. First, Title VII bars sex stereotyping—punishing an employer for her failure to conform to gender norms. When Rost fired Stephens for transitioning, Moore explained, he penalized her for failing to conform to the sex assigned to her at birth. “[A]n employer cannot discriminate on the basis of transgender status,” she concluded, “without imposing its stereotypical notions of how sexual organs and gender identity ought to align.”

Second, Moore wrote, anti-trans discrimination is inherently sex based. “[I]t is analytically impossible,” she noted, “to fire an employee based on that employee’s status as a transgender person without being motivated, at least in part, by the employee’s sex.” Any business that mistreats a worker on the basis of her “transgender or transitioning status,” then, is taking sex into account—in violation of Title VII.

Moore then turned to the RFRA, which states that any “substantial burden” on “religious exercise” must be “in furtherance of a compelling government interest” and “the least restrictive means of furthering” that interest. Here, the funeral home alleged two burdens: It claimed that the presence of a transgender employee would “often create distractions for the deceased’s loved ones” and force Rost to leave the industry, because working with a trans person infringes on his religious beliefs.

Neither of these, Moore held, qualify as substantial burdens. Regarding the first burden, Moore wrote that employers cannot skirt Title VII by making assumptions about customers’ “presumed biases.” A company may fear that its customers will be put off by a trans employee, or a black one, or a Muslim one. But these fears do not give it license to discriminate in violation of Title VII. Regarding the second burden, Moore wrote that “tolerating Stephens’s understanding of her sex and gender identity is not tantamount to supporting it.” Stephens did not ask Rost to endorse or aid her transition; she only wished to remain on staff. Allowing her to remain employed does not “substantially burden his religious practice.”

Finally, and just for good measure, Moore explained that even if Title VII imposed a “substantial burden” on Rost, it would still survive scrutiny under the RFRA. Preventing employment discrimination on the basis of sex clearly qualifies as a “compelling interest,” and there are no less “restrictive means” of forbidding such discrimination. To hold otherwise would be to riddle Title VII with exceptions and risk toppling the entire edifice of modern civil rights law.

In recent years, dozens of federal courts have held that federal civil rights statutes that bar sex discrimination protect LGBTQ people. Just last week, the 2nd U.S. Circuit Court of Appeals found that Title VII bars anti-gay discrimination using similar (though not identical) logic. Even arch-conservative judges have recognized that sex discrimination encompasses gender identity—though Attorney General Jeff Sessions now argues that it does not. With Harris Funeral Homes, the 6th Circuit joins the growing club of federal appeals courts to buck Sessions and recognize that Title VII means what it says.