The Michigan Supreme Court has ruled that the state's civil rights law bans discrimination on the basis of sexual orientation and gender identity.

In a 5-2 decision handed down on Thursday, the state's highest court said that Michigan's 1976 Elliott-Larsen Civil Rights Act's inclusion of the word “sex” as a protected category extended to the LGBTQ community.

Michigan companies Rouch World and Uprooted Electrolysis challenged the state's Civil Rights Commission's interpretation of the law.

The companies had refused to serve same-sex couples and transgender customers, which resulted in a state investigation.

The court's majority wrote that “discrimination 'because of … sex' … constitutes a violation” of the law.

Michigan's Republican-led Legislature has previously refused to add language to the law that specifically prohibits discrimination based on sexual orientation and gender identity.

Michigan Governor Gretchen Whitmer, a Democrat, said that the ruling “will save lives, protect families, and help ensure that every Michigander is treated with dignity and respect by law.”

The Michigan chapter of the Human Rights Campaign (HRC), the nation's largest LGBTQ rights advocate, praised the ruling.

“This is a day of immense pride and celebration,” HRC Michigan Director Amritha Venkataraman said in a statement. “The Michigan Supreme Court ruled not only in favor of equality, but they ruled in favor of human decency and rightful progress. Their decision marks a historic milestone in the advancement toward equal protection under the law for everyone in Michigan – regardless of who you love or how you identify. During a year when LGBTQ+ people have faced relentless attacks on our rights across the country – we recognize the relief and joy this ruling will bring to thousands of people whose right to receive a haircut or be served in a coffee shop, is now assured. There may be more work to do tomorrow, but this is a victory to celebrate today.”