Washington(CNN) The Supreme Court ruled in favor of a Colorado baker who refused to bake a cake to celebrate the marriage of a same sex couple because of a religious objection.
The ruling was 7-2.
The court held that the Colorado Civil Rights Commission showed hostility toward the baker based on his religious beliefs. The ruling is a win for baker Jack Phillips, who cited his beliefs as a Christian, but leaves unsettled broader constitutional questions on religious liberty.
"Today's decision is remarkably narrow, and leaves for another day virtually all of the major constitutional questions that this case presented," said Steve Vladeck, CNN Supreme Court analyst and professor at the University of Texas School of Law. "It's hard to see the decision setting a precedent."
The ruling, written by Justice Anthony Kennedy, held that members of the Colorado Civil Rights Commission showed animus toward Phillips specifically when they suggested his claims of religious freedom were made to justify discrimination.
The case was one of the most anticipated rulings of the term and was considered by some as a follow-up from the court's decision three years ago to clear the way for same-sex marriage nationwide. That opinion, also written by Kennedy, expressed respect for those with religious objections to gay marriage.
"Our society has come to the recognition that gay persons and gay couples cannot be treated as social outcasts or as inferior in dignity and worth," he wrote Monday.
Alliance Defending Freedom Senior Counsel Kristen Waggoner, who represented Phillips, praised the ruling.
"Jack serves all customers; he simply declines to express messages or celebrate events that violate his deeply held beliefs," Waggoner said in a statement. "Creative professionals who serve all people should be free to create art consistent with their convictions without the threat of government punishment."
She further added that the case "will affect a number of cases for years to come in free exercise jurisprudence. That's how the court's decisions work."
Waggoner said Phillips is "relieved" at the court's decision and that he will be working with the Alliance Defending Freedom to determine when to move forward to continue making wedding cakes.
"It's been a long, six-year battle where his family business, his income, has been hanging in the balance. He's also, obviously, handling a large volume of calls himself and looking out for the protection of his family, to be candid," Waggoner said.
Louise Melling, deputy legal director of the American Civil Liberties Union, emphasized the narrowness of the opinion.
"The court reversed the Masterpiece Cakeshop decision based on concerns unique to the case but reaffirmed its longstanding rule that states can prevent the harms of discrimination in the marketplace, including against LGBT people," Melling said in a statement.
Because Justice Clarence Thomas concurred in part, the judgment of the court on the case was 7-2 but the opinion on the rationale was 6-2.
Kennedy wrote that there is room for religious tolerance, pointing specifically to how the Colorado commission treated Phillips by downplaying his religious liberty concerns.
"At the same time the religious and philosophical objections to gay marriage are protected views and in some instances protected forms of expression," Kennedy wrote, adding that the "neutral consideration to which Phillips was entitled was compromised here."
"The commission's hostility was inconsistent with the First Amendment's guarantee that our laws be applied in a manner that is neutral toward religion," Kennedy said, adding to say that the case was narrow.
"The outcome of cases like this in other circumstances must await further elaboration in the courts, all in the context of recognizing that these disputes must be resolved with tolerance, without undue disrespect to sincere religious beliefs, and without subjecting gay persons to indignities when they seek goods and services in an open market," the opinion states.
Justice Ruth Bader Ginsburg, in her dissent which was joined by Justice Sonia Sotomayor, argued that "when a couple contacts a bakery for a wedding cake, the product they are seeking is a cake celebrating their wedding -- not a cake celebrating heterosexual weddings or same-sex weddings -- and that is the service (the couple) were denied."
Phillips opened the bakery in 1993, knowing at the outset that there would be certain cakes he would decline to make in order to abide by his religious beliefs.
"I didn't want to use my artistic talents to create something that went against my Christian faith," he said in an interview with CNN last year, noting that he has also declined to make cakes to celebrate Halloween.
In 2012, David Mullins and Charlie Craig asked Phillips to bake a cake to celebrate their planned wedding, which would be performed in another state. Phillips said he couldn't create the product they were looking for without violating his faith.
"The Bible says, 'In the beginning there was male and female,'" Phillips said.
He offered to make any other baked goods for the men. "At which point they both stormed out and left," he said.
Mullins and Craig filed a complaint with the Colorado Civil Rights Commission, which ruled in their favor, citing a state anti-discrimination law. Phillips took his case to the Colorado Court of Appeals, arguing that requiring him to provide a wedding cake for the couple violated his constitutional right to freedom of speech and free exercise of religion. The court held that the state anti-discrimination law was neutral and generally applicable and did not compel Phillips' Masterpiece Cakeshop to "support or endorse any particular religious view." It simply prohibited Phillips from discriminating against potential customers on account of their sexual orientation.
"This case is about more than us, and it's not about cakes," Mullins said in an interview last year. "It's about the right of gay people to receive equal service."
The Trump administration sided with Phillips.
"A custom wedding cake is not an ordinary baked good; its function is more communicative and artistic than utilitarian," Solicitor General Noel Francisco argued. "Accordingly, the government may not enact content-based laws commanding a speaker to engage in protected expression: An artist cannot be forced to paint, a musician cannot be forced to play, and a poet cannot be forced to write."
This story has been updated.