The Supreme Court is expected to rule later this year on a potentially landmark case that pits religious freedom against anti-discrimination laws.

The controversy began when Jack Phillips, owner of Masterpiece Cakeshop in Colorado, refused to create a wedding cake for a same-sex couple in 2012, citing his religious beliefs. While he maintains that he serves anyone who comes into his shop, he does not cater to every event.

A state civil rights commission sanctioned Phillips after the gay couple filed a formal complaint.

“This case has never been about cakes. It’s about the rights of gay people to receive equal service in businesses and not be afraid of being turned away because of who they are,” David Mullins, who attempted to hire Phillips to bake a wedding cake in 2012, told Fox News. “It’s about basic access to public life.”

After nearly 90 minutes of oral arguments in December 2017, the Supreme Court justices appeared to be equally divided along ideological lines about the case. A ruling is expected by June 2018.

Here are three other cases that could be instrumental for the justices’ decision.

Obergefell v. Hodges

Obergefell v. Hodges was the landmark 2015 Supreme Court case that made same-sex marriage legal across the country. The nation’s highest court determined that the 14th Amendment guaranteed same-sex couples could obtain marriage licenses.

Justice Anthony Kennedy delivered the opinion of the court along with Justices Ruth Bader Ginsburg, Stephen Breyer, Elena Kagan and Sonia Sotomayor.

Chief Justice John Roberts along with Justices Clarence Thomas, Samuel Alito and the late Antonin Scalia dissented.

Newman v. Piggie Park Enterprises, Inc.

In 1964, two African-Americans were refused service at a Piggie Park drive-in in Columbia, S.C., because of their race. In the civil rights lawsuit that followed, Piggie Park owner Maurice Bessinger justified the refusal to serve black customers based on his religious belief opposing "any integration of the races whatsoever."

By the time Newman v. Piggie Park Enterprises, Inc. made it to the Supreme Court in 1968, the issue was the award of fees to the lawyers representing the black South Carolinians who sued Bessinger's restaurants. But in a footnote to its unsigned 8-0 opinion, the court called the religious freedom argument and Bessinger's other defenses "patently frivolous."

Civil rights attorneys have pointed to that footnote as a possible guide for current justices regarding the gay cake case.

Department of Fair Employment and Housing v. Cathy’s Creations, Inc.

A California judge ruled in favor of a bakeshop owner earlier this month, allowing her to continue to refuse to create wedding cakes for same-sex couples because it violates her religious beliefs.

Kern County Superior Court Judge David Lampe said Cathy Miller, owner of Tastries Bakery in Bakersfield, Calif., was being asked to make a cake for an event and that the act of creating it was protected artistic expression. He denied the state’s request for a preliminary injunction to force Miller to design a wedding cake while awaiting the full trial.

Miller was approached by a same-sex couple in August 2017, who asked for the bakery to design a wedding cake. Miller said she told the couple she could not bake the cake as she is a Christian, but offered to set up an appointment for them with one of her local competitors, KGET-TV reported.

In his ruling, Lampe cautioned that the freedom of religion does not give businesses a right to refuse service to specific groups of people altogether, making note of the difference between creating a product for a specific event and selling a product, according to The Bakersfield Californian.

The next hearing is scheduled for June, but Miller’s attorney is hoping for the case to be dismissed after Lampe’s ruling, the newspaper reported.

Fox News’ Bill Mears and The Associated Press contributed to this report.