For the better part of the past decade, Aimee Stephens was fighting two battles: one against kidney disease, and another that went to the Supreme Court, a potential landmark case over her 2013 firing after coming out to her boss as transgender.

But on Tuesday, after having recently entered hospice care following years of kidney failure, Stephens lost one battle without living to see the end of the other.

She died at her home in Michigan at 59 — likely just days or weeks away from a Supreme Court ruling in her case.

Stephens’s case is the first major transgender civil rights matter that the high court has heard, with potentially sweeping implications for transgender people nationwide seeking protections from being fired because of their gender identity. That Stephens will not be alive to witness its outcome has devastated her family, legal team and the countless people in the LGBT community she inspired, the American Civil Liberties Union, which represents Stephens, said in a statement.

Her wife, Donna Stephens, thanked everyone on Tuesday “from the bottom of our hearts for your kindness, generosity, and keeping my best friend and soulmate in your thoughts and prayers.” Stephens also leaves behind a daughter, Elizabeth.

“Aimee is an inspiration. She has given so many hope for the future of equality for LGBTQ people in our country, and she has rewritten history,” Donna said in a statement provided by the ACLU. “The outpouring of love and support is our strength and inspiration now.”

The Supreme Court heard oral arguments in Stephens’s case last fall, as well as in two other cases involving gay men who say they were fired because of their sexual orientation. The court is expected to issue its ruling before the end of the spring term on R.G. & G.R. Harris Funeral Homes Inc. v. Equal Employment Opportunity Commission.

The question is whether Title VII of the Civil Rights Act of 1964, which prohibits sex discrimination in employment, also applies to transgender and gay people. The law itself does not say, so the issue has been left to the courts.

State laws do not protect them from discrimination on the basis of sexual orientation or gender identity in more than half the states.

Writing in a column for The Washington Post last summer, Stephens said she “would like to believe that the United States — and the Supreme Court — will see that transgender people should be able to live free from discrimination in the workplace and beyond.”

“No one should face discrimination because of who they are,” she wrote. “My case is about so much more than me — or even transgender people. It’s about anyone who has ever been told they are not enough of a man or not the right kind of a woman. It’s about anyone who has ever experienced sex discrimination. It’s about making sure the same thing doesn’t happen to someone else.”

Stephens, who worked for more than 30 years as a funeral director, was born on Dec. 7, 1960, in Fayetteville, N.C., and raised in a conservative Southern Baptist family. With little to no exposure to the LGBT community in the early years of her life, Stephens told The Post last year that she struggled to understand the gender dysphoria she experienced for so many years. It wasn’t until she saw a therapist much later in life, after coming out to her wife in 2009, that she realized there were others like her, she said.

But coming out to her co-workers was more difficult.

In the summer of 2013, she had reached a breaking point. She felt she could no longer go on living a split life, and so Stephens sat down to draft the most consequential letter of her life.

“Dear Friends and Co-Workers,” she began. “What I must tell you is very difficult for me and is taking all the courage I can muster.”

She revealed to them her true identity as a transgender woman, and said she was finally going to allow herself to express her identity at work too, trading the suit and tie for the required skirt or dress.

“I realize that some of you may have trouble understanding this. In truth, I have had to live with it every day of my life and even I do not fully understand it myself,” she wrote. “As distressing as this is sure to be to my friends and some of my family, I need to do this for myself and for my own peace of mind, and to end the agony in my soul.”

She presented the letter to her boss in the chapel of the funeral home on July 31, 2013.

Two weeks later, she was fired.

Thomas Rost, the owner of the funeral home and her boss, has said in court proceedings that he fired Stephens “because he was no longer going to represent himself as a man. … He wanted to dress like a woman.”

Stephens previously said she was offered a severance package in exchange for a promise not to sue, but Stephens refused.

“Money at that point was not important,” she told The Post last year. “It was the principle. Nobody should be fired over something like that.”

The U.S. Court of Appeals for the 6th Circuit ruled in Stephens’s favor in 2018. Citing a 1989 ruling that dealt with gender stereotypes, the court found that Title VII’s protection against sex discrimination must necessarily extend to transgender people, reasoning that it is “analytically impossible” to fire someone based on a person’s gender identity “without being motivated, at least in part, by the employee’s sex.”

The U.S. Court of Appeals for the 2nd Circuit used similar logic to rule in favor of skydiving instructor Donald Zarda, who said he was fired after revealing he was gay. But the U.S. Court of Appeals for the 11th Circuit rejected that reasoning in another case involving Gerald Bostock, a gay social worker.

Zarda also tragically died before hearing the end of his legal battle, in a base-jumping accident in 2014.

Like in Zarda’s case, Stephens’s estate will continue to fight on her behalf.

“Aimee did not set out to be a hero and a trailblazer, but she is one, and our country owes her a debt of gratitude for her commitment to justice for all people and her dedication to our transgender community,” Chase Strangio, the deputy director for Trans Justice with the ACLU’s LGBT & HIV Project, wrote in a statement, adding: “As a transgender person and an advocate, I am filled with both grief and rage that we have lost an elder far too soon. As we, and millions, carry her work for justice forward, may she rest in power and continue to guide us on this path.”