A federal court on Thursday dismissed a case of a transgender funeral home employee in Michigan who claimed she was fired because of her gender transition.

Aimee Australia Stephens was hired by a funeral home in the Detroit area in 2007 under her legal name at the time, Anthony Stevens, according to court documents. She worked as a funeral director and embalmer for the home until 2013, when she notified her employers that she would be having sex reassignment surgery and planned to return to work dressed as a woman, which would require her to wear a “skirt-suit” under the home’s dress code.

“At the end of my vacation on August 26, 2013, I will return to work as my true self … in appropriate business attire,” she wrote.

Thomas Rost, the owner of R.G. &. G.R. Harris Funeral Homes, fired Stephens two weeks after she wrote the letter.

“It was right before he was going to go on vacation and I just — I said — I just said ‘Anthony, this is not going to work out,'” Rost testified.

Stephens filed a complaint with the Equal Employment Opportunity Commission (EEOC), saying she had been discriminated against.

“I can only conclude that I have been discharged due to my sex and gender identity, female, in violation of Title VII of the Civil Rights Act of 1964,” her complaint read.

When the EEOC took the case to federal court, the court noted that Stephens had no civil rights claim because, “like sexual orientation, transgender or transsexual status is currently not a protected class under Title VII.”

But had the funeral home nonetheless fired Stephens based on sex stereotypes of how men and women should dress — a possible violation of Title VII?

To answer this claim, the funeral home sought protection under the federal Religious Freedom Restoration Act (RFRA), saying Rost’s religious liberty would be infringed if he kept Stephens — to Rost, a man dressed as a woman — on staff. And the court agreed, dismissing Stephens’s wrongful termination claim and granting the funeral home a RFRA exemption from Title VII.

“Rost sincerely believes that the ‘Bible teaches that a person’s sex (whether male or female) is an immutable God-given gift and that it is wrong for a person to deny his or her God-given sex,’” Judge Sean F. Cox of the U.S. District Court for Michigan’s Eastern District noted. He added: “Requiring the Funeral Home to provide a skirt to and/or allow an employee born a biological male to wear a skirt at work would impose a substantial burden on the ability of Rost to conduct his business in accordance with his sincerely-held religious beliefs.”

Cox also questioned the EEOC’s claims about dress codes and gender stereotypes.

“The EEOC wants Stephens to be able to dress in a stereotypical feminine manner,”  he wrote. “If the compelling governmental interest is truly in removing or eliminating gender stereotypes in the workplace in terms of clothing (i.e., making gender ‘irrelevant’), the EEOC’s manner of enforcement in this action (insisting that Stephens be permitted to dress in a stereotypical feminine manner at work) does not accomplish that goal.”

The EEOC was not happy.

“We are disappointed with the decision and are reviewing next steps,” EEOC spokesman Justine Lisser said.

Douglas Wardlow, a lawyer with Alliance Defending Freedom — a “legal organization that advocates for the right of people to freely live out their faith,” according to its website — represented the funeral home, and said the decision was “a victory for the proposition that the government should not be able to coerce religious private employers to abandon sincerely held beliefs.”

“It shows RFRA works as intended,” Wardlow said. “It lets the court weigh the interest of a religious person and make sure they are not discriminated against.”

Wardlow also said the case was one of two the Obama administration moved forward “to expand Title VII without going through Congress.” The other, a claim brought by a transgender employee of an eye clinic in Florida who said she was fired after she came out, was settled out of court last year when the clinic agreed to pay $150,000.

The EEOC praised the result of the Florida case last year.

“This historic settlement is significant,” David Lopez, EEOC general counsel, said at the time. “It not only is one of the first two lawsuits ever filed by the Commission alleging sex discrimination against a transgender individual, but it also solidifies the EEOC’s commitment to enforcing the rights of transgender employees secured by Title VII.”