In a 5-2 decision on Thursday, the Michigan Supreme Court ruled in Rouch World, LLC v Department of Civil Rights that the state’s 1976 Elliott-Larsen Civil Rights Act bans discrimination on the basis of sexual orientation and gender identity.

The case, brought by the Michigan companies Rouch World and Uprooted Electrolysis, sought to challenge the state’s Civil Rights Commission for its interpretation of the law that classified sexual orientation and gender identity as protected classes.

The lawsuit came in the wake of the companies’ refusal to serve transgender customers and those in same-sex relationships, prompting customer complaints that resulted in Civil Rights Commission investigations.