Jack Phillips spoke to the media after leaving the Supreme Court which heard the 'Masterpiece Cakeshop v. Colorado Civil Rights Commission,' Tuesday, Dec. 5, 2017, in Washington.

Jacquelyn Martin/AP

Published 8:35 a.m. | Updated 12:31 p.m.

The Supreme Court of the United States has ended a five-year legal battle in the Masterpiece Cakeshop v. Colorado Civil Rights Commission case, ruling that the commission’s actions violated the Free Exercise Clause.

The court is not deciding the big issue in the case, whether a business can invoke religious objections to refuse service to gay and lesbian people.

Justice Anthony Kennedy wrote the opinion for the court, which voted 7-2 to reverse a lower court's ruling. Justices Ginsburg and Sotomayor dissented. The justices' limited ruling turned on what the court described as anti-religious bias on the Colorado Civil Rights Commission when it ruled against baker Jack Phillips.

The ruling stated:

Whatever the confluence of speech and free exercise principles might be in some cases, the Colorado Civil Rights Commission’s consideration of this case was inconsistent with the State’s obligation of religious neutrality. The reason and motive for the baker’s refusal were based on his sincere religious beliefs and convictions. The Court’s precedents make clear that the baker, in his capacity as the owner of a business serving the public, might have his right to the free exercise of religion limited by generally applicable laws. Still, the delicate question of when the free exercise of his religion must yield to an otherwise valid exercise of state power needed to be determined in an adjudication in which religious hostility on the part of the State itself would not be a factor in the balance the State sought to reach. That requirement, however, was not met here. When the Colorado Civil Rights Commission considered this case, it did not do so with the religious neutrality that the Constitution requires.

The Human Right's Campaign, the country's largest LGBTQ rights organization, said in a statement that the ruling found that Colorado's "enforcement of its civil rights law was flawed, while reaffirming that LGBTQ Americans should not face discrimination in the provision of goods and services and state law may continue to prohibit such discrimination."

The Alliance Defending Freedom, the legal team that represented Phillips, were pleased with the court’s decision.

"The court’s decision today makes very clear that the government must respect Jack Phillips’ beliefs about marriage," said Kristen Waggoner, senior vice president with the ADF in a statement. "If we want to have freedom for ourselves, we have to extend it to those with whom we disagree."

The ADF still needs time to review the ruling, but they are excited to work with Phillips to establish the timing and process where he can reenter the wedding cake business.

The result wasn’t the ruling that the ACLU was looking for, but the civil rights organization sees the Supreme Court’s decision as narrowly defined to concerns the court had with Colorado’s civil rights commission.

"The bakery may have won the battle, but it’s lost the war," said James Esseks, director of the ACLU Lesbian Gay Bisexual Transgender & HIV Project. "This decision is not going to be — the concerns that the court had about the Colorado Civil Rights Commission and comments by some of its commissioners — is very unlikely to be repeated in any other circumstance."

"Instead, the court made quite clear that it was not buying what the bakery was selling here," Esseks continued. He noted that there’s nothing in the decision that says a businesses can discriminate.

The case started in the summer of 2012 when Charlie Craig and David Mullins went to Jack Phillips’ Masterpiece Cakeshop in Lakewood. They wanted to order a wedding cake for a Colorado party to celebrate their marriage in Massachusetts.

Phillips declined to take the order. He was happy to sell them off-the-counter products like cookies or brownies, but creating a custom-made cake for a same-sex wedding went against his Christian beliefs.

“In everything I do, I think about how people will perceive Christ through me, by what I sell, what I make,” Phillips told The Associated Press in 2014.

Mullins and Craig saw something else. They posted about their experience on Facebook, and soon another chapter in the nation’s culture wars was underway. At issue is the tension between Colorado’s discrimination laws and freedom of expression and religion.

First, they filed a complaint with the Colorado Civil Rights Commission, saying the bakery violated the state’s public accomodation laws against discrimination. According to the CCRC, that discrimination includes “denial of service, terms and conditions, unequal treatment” based on a variety of factors including sexual orientation.

In May 2014, the CCRC sided with Mullins and Craig and said Masterpiece was in violation of the public accommodation laws. In July that same year, Phillips appealed the order to the Colorado Court of Appeals. His attorneys argued that decision violates Phillips' First Amendment rights.

The state appeals court sided with Mullins and Craig in August 2015. In its ruling, the court said in part:

Masterpiece argues that wedding cakes inherently convey a celebratory message about marriage and, therefore, the Commission’s order unconstitutionally compels it to convey a celebratory message about same-sex marriage in conflict with its religious beliefs.

We disagree. We conclude that the Commission’s order merely requires that Masterpiece not discriminate against potential customers in violation of [the Colorado Anti-Discrimination Act] and that such conduct, even if compelled by the government, is not sufficiently expressive to warrant First Amendment protections.

“Masterpiece does not convey a message supporting same-sex marriages merely by abiding by the law and serving its customers equally,” the ruling said. Next, Phillips turned to the Colorado Supreme Court, but to no avail. In October 2017, the court said it wouldn’t take the case.

In the meantime, while the case worked its way through the state’s highest court, the Alliance for Defending Freedom, a conservative legal group representing Phillips in the case, had appealed to the Supreme Court in July of 2016. The nation’s high court eventually agreed to hear the case, granting the petition in June 2017.

Last December, Jack Phillips, Charlie Craig and David Mullins, and their respective attorneys, made their cases before the high court.

The Associated Press contributed to this report.