WASHINGTON — The U.S. Supreme Court on Tuesday heard arguments in a Colorado case about a same sex-wedding cake that ultimately could determine where the legal system draws the line between discrimination and religious freedom.

The legal fight stems from the refusal of Lakewood baker Jack Phillips in 2012 to make a wedding cake for fiancés Charlie Craig and David Mullins. Phillips argues he shouldn’t be compelled to violate his religious beliefs by creating a custom dessert for the couple; they argue they are being discriminated against because of their sexual orientation, which is protected by Colorado law.

Brendan Smialowski, AFP/Getty Images Charlie Craig (L) and his spouse, Dave Mullins (C), talk to the media outside the U.S. Supreme Court as Masterpiece Cakeshop vs. Colorado Civil Rights Commission is heard on Dec. 5, 2017 in Washington, D.C.

Brendan Smialowski, AFP/Getty Images Jack Phillips, owner of Masterpiece Cakeshop in Lakewood, Colorado speaks outside the U.S. Supreme Court as Masterpiece Cakeshop vs. Colorado Civil Rights Commission is heard on Dec. 5, 2017 in Washington, D.C. in this file photo.

Brendan Smialowski, AFP/Getty Images Jack Phillips (bottom L), owner of "Masterpiece Cakeshop" in Lakewood, Colorado waves outside the U.S. Supreme Court as Masterpiece Cakeshop vs. Colorado Civil Rights Commission is heard on Dec. 5, 2017 in Washington, D.C.



Brendan Smialowski, AFP/Getty Images The U.S. Supreme Court is seen while arguments for Masterpiece Cakeshop vs. Colorado Civil Rights Commission is heard on Dec. 5, 2017 in Washington, D.C.

Brendan Smialowski, AFP/Getty Images People rally for Jack Phillips, owner of Masterpiece Cake in Colorado, outside the U.S. Supreme Court before Masterpiece Cakeshop vs. Colorado Civil Rights Commission is heard on Dec. 5, 2017 in Washington, D.C.

Brendan Smialowski, AFP/Getty Images People rally for Jack Phillips, owner of Masterpiece Cake in Colorado, outside the U.S. Supreme Court before Masterpiece Cakeshop vs. Colorado Civil Rights Commission is heard on Dec. 5, 2017 in Washington, D.C.



Brendan Smialowski, AFP/Getty Images People rally for Jack Phillips, owner of Masterpiece Cake in Colorado, outside the U.S. Supreme Court before Masterpiece Cakeshop vs. Colorado Civil Rights Commission is heard on Dec. 5, 2017 in Washington, D.C. The landmark case pits a gay couple, Dave Mullins and Charlie Craig, against a Colorado bakery owner who refused in July 2012 to make a cake for their same-sex wedding reception.

Chip Somodevilla, Getty Images Charlie Craig (L) and Dave Mullins acknowledge supporters before entering the Supreme Court building Dec. 5, 2017 in Washington, D.C. Craig and Mullins filed a complaint with the Colorado Civil Rights Commission after conservative Christian baker Jack Phillips refused to sell them a wedding cake for their same-sex ceremony.

Chip Somodevilla, Getty Images Protesters on both sides of the issue argue in front of the Supreme Court building on the day the court is to hear the case Masterpiece Cakeshop v. Colorado Civil Rights Commission Dec. 5, 2017 in Washington, D.C. Charlie Craig and Dave Mullins filed a complaint with the commission after conservative Christian baker Jack Phillips refused to sell them a wedding cake for their same-sex ceremony.



Brendan Smialowski, AFP/Getty Images People gather outside the US Supreme Court before Masterpiece Cakeshop vs. Colorado Civil Rights Commission is heard on Dec. 5, 2017 in Washington, D.C. The US Supreme Court is to hear arguments on Tuesday in a case that has been described as the most significant for gay rights since it approved same-sex marriage two years ago. The landmark case pits a gay couple, Dave Mullins and Charlie Craig, against a Colorado bakery owner who refused in July 2012 to make a cake for their same-sex wedding reception.

Chip Somodevilla, Getty Images A U.S. Supreme Court police officer hands out tickets for people to hear oral arguements on the day the court is to hear the case Masterpiece Cakeshop v. Colorado Civil Rights Commission Dec. 5, 2017 in Washington, D.C. Charlie Craig and Dave Mullins filed a complaint with the commission after conservative Christian baker Jack Phillips refused to sell them a wedding cake for their same-sex ceremony.

Chip Somodevilla, Getty Images Protesters rally in front of the Supreme Court building on the day the court is to hear the case Masterpiece Cakeshop v. Colorado Civil Rights Commission Dec. 5, 2017 in Washington, D.C. Charlie Craig and Dave Mullins filed a complaint with the commission after conservative Christian baker Jack Phillips refused to sell them a wedding cake for their same-sex ceremony.



Jacquelyn Martin, The Associated Press As Janae Stracke, left, and Annabelle Rutledge, both with Concerned Women for America, hold up signs, as Jessica Haas, of Indianapolis, paints during a rally with supporters of cake artist Jack Phillips outside of the Supreme Court which is hearing the 'Masterpiece Cakeshop v. Colorado Civil Rights Commission' today, Tuesday, Dec. 5, 2017, in Washington.

Jacquelyn Martin, The Associated Press Janae Stracke, left, and Annabelle Rutledge, both with Concerned Women for America, hold up signs in support of cake artist Jack Phillips outside of the Supreme Court which is hearing the 'Masterpiece Cakeshop v. Colorado Civil Rights Commission,' Tuesday, Dec. 5, 2017, in Washington.

Jacquelyn Martin, The Associated Press Sen. Cory Booker, D-N.J., left, takes a selfie with Caitlin Rooney, who is with the Center for American Progress and dressed as the Constitution, during a rally outside of the Supreme Court which is hearing the 'Masterpiece Cakeshop v. Colorado Civil Rights Commission' today, Tuesday, Dec. 5, 2017, in Washington.



Jacquelyn Martin, The Associated Press A woman holds up a sign as people gather outside of the Supreme Court which is hearing the 'Masterpiece Cakeshop v. Colorado Civil Rights Commission' today, Tuesday, Dec. 5, 2017, in Washington.

Jacquelyn Martin, The Associated Press Lydia Macy, 17, left, and Mira Gottlieb, 16, both of Berkeley, Calif., rally outside of the Supreme Court which is hearing the 'Masterpiece Cakeshop v. Colorado Civil Rights Commission' today, Tuesday, Dec. 5, 2017, in Washington.

Jacquelyn Martin, The Associated Press People sleep outside of the Supreme Court in order to save places in line for Dec. 5 arguments in 'Masterpiece Cakeshop v. Colorado Civil Rights Commission,' Monday, Dec. 4, 2017, outside of the Supreme Court in Washington.



During the 90-minute hearing, all eyes in the crowded courtroom were on Justice Anthony Kennedy — widely believed to be the swing vote on the ideologically divided court.

Kennedy wrote the majority opinion in the 2015 case Obergefell vs. Hodges that legalized same-sex marriage, but the Ronald Reagan appointee previously has lent a sympathetic ear to arguments of religion and freedom of expression.

He had tough questions and comments for both sides.

Kennedy posed a question to Phillips’ attorneys: If the baker’s cakes were truly expressive and an extension of his First Amendment rights, would that make it OK for him to refuse to sell any of his cakes – and not just a custom one?

Kennedy also wondered whether the case could give a rise to a national movement to deny wedding cakes to same-sex couples.

“If you prevail, could the baker put a sign in his window, ‘We do not bake cakes for gay weddings’?” he asked.

But Kennedy also questioned whether the Colorado Civil Rights Commission took appropriate action when it disciplined Phillips for not serving Craig and Mullins.

“It seems to me that the state in its position here has been neither tolerant nor respectful of Mr. Phillips’ religious beliefs,” he said.

If there is one area where both sides agree, it’s that the stakes in this high-court confrontation are huge and the court’s eventual ruling — expected by next summer — could have far-reaching implications.

A victory for Phillips would open the door for more businesses to use religion and expression as an excuse for discrimination, argued David Cole of the American Civil Liberties Union.

“We don’t doubt the sincerity of Mr. Phillips’ convictions. But to accept his argument leads to unacceptable consequences,” Cole said. “A bakery could refuse to sell a birthday cake to a black family if it objected to celebrating black lives. A corporate photography studio could refuse to take pictures of female CEOs if it believed that a woman’s place is in the home.”

But attorneys on the side of the Lakewood baker countered that the First Amendment rights of creative professionals were the real issue for the court.

“They believe that they can compel speech, of filmmakers, oil painters, and graphic designers in all kinds of context,” said Kristen Waggoner, of Alliance Defending Freedom, in response to the arguments of the ACLU and its allies.

One vexing issue for the nine-member court was defining which professions were expressive and should be protected by the First Amendment. Compounding that question was whether there were differences even within an industry or even one shop — say, between a sheet cake and a carefully crafted wedding dessert.

“What is the line? How would you have this court draw the line?” asked Justice Neil Gorsuch, a Colorado native and the Supreme Court’s newest member.

Noel Francisco, the U.S. solicitor general for the Trump administration, took the side of the baker and pointed to the cost as one clue.

“People pay very high prices for these highly sculpted cakes, not because they taste good, but because of their artistic qualities,” he said.

In another exchange — between Waggoner and Justice Elena Kagan — the expressive rights of hairstyling and makeup were compared to those of a baker.

“Why is there no speech in creating a wonderful hairdo?” Kagan asked.

“The makeup artist may again, be using creativity and artistry, but when this court is looking at whether speech is involved, it asks the question of, is it communicating something, and is it analogous to other protected forms of speech?” Waggoner answered.

Said Kagan in response: “Because, you know, a makeup artist, I think, might feel exactly as your client does, that they’re doing something that’s of great aesthetic importance” to an event like a wedding.

“There’s a lot of skill and artistic vision that goes into making somebody look beautiful. And why wouldn’t that person or the hairstylist — why wouldn’t that also count?” she added.

The Tuesday morning hearing was the latest chapter in a legal battle that dates to 2012, when Craig and Mullins went into Masterpiece Cakeshop ahead of their nuptials.

“Charlie was carrying a binder full of concepts and ideas that we had come up with, but we never even got a chance to open it,” said Mullins in a press call last week. “As soon as we sat down with the owner, he asked who the cake was for, we said it was for us, and he immediately informed us that he wouldn’t make a cake for a same-sex wedding.”

Afterward the two men filed discrimination charges with the Colorado Civil Rights Commission. The panel agreed with Craig and Mullins, as did the Colorado Court of Appeals when Phillips took his case there.

The loss meant that Phillips’ business, Masterpiece Cakeshop, had to reorient itself to deal with Colorado’s anti-discrimination laws, including staff training and follow-up reports with the state. His attorneys have argued the ruling and legal fight have cost him substantially.

“By effectively forcing him to stop designing wedding cakes, the commission stripped Phillips of roughly 40 percent of his family income, which caused him to lose most of his employees,” they wrote.

Phillips appealed his case to the U.S. Supreme Court, which agreed in June to hear the dispute.

The case has attracted widespread national attention. For days, onlookers have lined up outside the court for a chance to see the proceedings, and on Tuesday morning a crowd of hundreds gathered on the court’s marble steps to advocate for one view or another.

Some carried signs in support of Phillips.

“We got your back, Jack,” read one. “Should any government force its people to celebrate sin?” read another.

A few feet away, a man dressed in shorts and a giant Bible costume carried his own sign that said: “Use me not for your bigotry.” Club music played in the background of a chilly morning.

Ben Hogue had stood in line outside the courthouse since 3:30 a.m. He wore a clerical collar and a rainbow-flag pin, and the former Grand Junction resident — now a Washington, D.C., denizen — said he felt “called to stand with people who are being discriminated against and marginalized.”

Hogue, a vicar at the nearby Lutheran Church of the Reformation, said he recognized Phillips’ right to free expression and agreed “we ought to defend the First Amendment.”

But he added that “it’s when people become oppressed and discriminated against (under) the guise of the First Amendment is where I sort of have a problem.”