The U.S. Supreme Court on Monday handed a victory on narrow grounds to a Christian baker from Colorado who refused for religious reasons to make a wedding cake for a gay couple, stopping short of setting a major precedent allowing people to claim exemptions from anti-discrimination laws based on religious beliefs.

The justices, in a 7-2 decision, said the Colorado Civil Rights Commission showed an impermissible hostility toward religion when it found that baker Jack Phillips violated the state's anti-discrimination law by rebuffing gay couple David Mullins and Charlie Craig in 2012.

The state law bars businesses from refusing service based on race, sex, marital status or sexual orientation.

The original plaintiffs in the Masterpiece Cakeshop case, Charlie Craig, left, and David Mullins, wait to address supporters following oral arguments at the Supreme Court on Tuesday, Dec. 5, 2017, in Washington. (Kevin Wolf/Associated Press for Human Rights Campaign)

The ruling concluded that the commission violated Phillips' religious rights under the U.S. Constitution's First Amendment.

But the court did not issue a definitive ruling on the circumstances under which people can seek exemptions from anti-discrimination laws based on their religious views.

The decision also did not address several of the claims raised in the case, including whether baking a cake is a kind of expressive act protected by the constitution's guarantee of free speech.

'Further elaboration' needed

Two of the court's four liberals, Stephen Breyer and Elena Kagan, joined the five conservative justices in the ruling authored by Justice Anthony Kennedy.

"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 wrote, referring to the First Amendment of the U.S. Constitution.

But Kennedy also stressed the importance of gay rights while noting that litigation on similar issues is likely to continue in lower courts.

"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.

"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," Kennedy said.

Of the 50 states, 21, including Colorado, have anti-discrimination laws protecting people in the LGBTQ community.

Government hostility toward people of faith has no place in our society, yet the state of Colorado was openly antagonistic toward Jack's religious beliefs about marriage. - Kristen Waggoner , Alliance Defending Freedom

The closely watched case before the Supreme Court, which in 2015 legalized same-sex marriage nationwide, pitted gay rights against religious liberty. President Donald Trump's administration intervened in the case in support of Phillips.

Mullins and Craig were planning their wedding in Massachusetts in 2012 and wanted the cake for a reception in Colorado, where gay marriage was not yet legal. During a brief encounter at Phillips's Masterpiece Cakeshop in the Denver suburb of Lakewood, the baker politely but firmly refused, leaving the couple distraught.

They filed a successful complaint with the state commission, the first step in the six-year legal battle. State courts sided with the couple, prompting Phillips to appeal to the U.S. top court. Phillips has said a backlash against his business has left him struggling to keep the shop afloat.

The outcome of the case hinged on the actions of the Colorado commission. In one exchange at a 2014 hearing cited by Kennedy, former commissioner Diann Rice said that "freedom of religion, and religion, has been used to justify all kinds of discrimination throughout history, whether it be slavery, whether it be the Holocaust."

'Openly antagonistic'

Kennedy also noted that the commission had ruled the opposite way in three other cases brought against bakers in which the business owners had refused to bake cakes containing messages they disagreed with that demeaned gay people or same-sex marriage.

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. - Louise Melling, ACLU

"Government hostility toward people of faith has no place in our society, yet the state of Colorado was openly antagonistic toward Jack's religious beliefs about marriage. The court was right to condemn that," said Kristen Waggoner, a lawyer at conservative Christian group Alliance Defending Freedom, which represents Phillips.

She added that the decision "makes clear that the government must respect Jack's beliefs about marriage."

ACLU lawyer Louise Melling, who represents Mullins and Craig, said that high court had made it clear that businesses

open to the public must serve everyone.

"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 added.

Faith or discrimination

Phillips' lawyers argued that his cakes are an art form — a "temporary sculpture" — and being forced to create one to commemorate a gay wedding would violate his rights under the U.S. Constitution to freedom of speech and expression and free exercise of religion.

Mullins and Craig, represented by the American Civil Liberties Union, said Phillips was using his Christian faith as pretext for unlawful discrimination based on sexual orientation. The ACLU said the baker was advocating for a "licence to discriminate" that could have broad repercussions beyond gay rights.

The case became a cultural flashpoint in the United States, underscoring the tensions between gay rights proponents and conservative Christians.

The litigation, along with similar cases around the country, is part of a conservative Christian backlash to the Supreme Court's gay marriage ruling. Phillips and others like him who believe that gay marriage is not consistent with their Christian beliefs, have said they should not be required to effectively endorse the practice.

Gay rights advocates said the case is just one part of a bigger struggle seeking greater legal protections for gay, bisexual and transgender people, including in the workplace, even as they fight efforts by conservatives to undermine gains secured in recent years.