Image copyright Getty Images Image caption David Mullins (left) and Charlie Craig wanted a wedding cake to celebrate their planned marriage

The US Supreme Court appeared divided after hearing heated arguments in the case of a Colorado baker who refused to make a wedding cake for a gay couple.

Baker Jack Phillips turned away David Mullins and Charlie Craig in making such a cake in 2012, saying it was against his Christian belief.

A legal battle ensued, with Colorado's court finding that the baker's actions represented unlawful discrimination.

The baker says this violates his rights to religious freedom and free speech.

Justice Anthony Kennedy, a conservative who sided with liberal judges in the landmark 2015 decision legalising same-sex marriage, questioned whether the state's civil rights commission ruling against the baker was biased against religion.

"Tolerance is essential in a free society," he said on Tuesday. "Tolerance is most meaningful when it's mutual."

Justice Kennedy, a strong advocate for free speech rights, added that the ruling had "neither been tolerant nor respectful of Mr Phillips's religious beliefs".

But he also raised concerns about whether ruling in favour of the baker would lead to more discrimination against the gay community during the extended 80-minute hearing.

The liberal judges appeared to echo Justice Kennedy's question.

"Where is the line?" Justice Stephen G Breyer asked. "That is what everyone is trying to get at."

The case is considered one of the most high profile in the conservative-majority court's ninth-month term.

How did the case come around?

In July 2012, Mr Mullins and Mr Craig went to Mr Phillips's Masterpiece Cakeshop in Lakewood, near Denver, to order a cake for a party to celebrate their planned marriage in Massachusetts later that year.

But Mr Phillips refused, saying it was his "standard business practice not to provide cakes for same-sex weddings".

Instead, he offered them other products, including birthday cakes and biscuits.

The couple later filed a successful complaint with the Colorado Civil Rights Commission.

Image copyright Reuters

Colorado bans businesses from discriminating against customers based on race and sexual orientation.

In 2015, Colorado's appeals court upheld the decision, with the state's supreme court later denying review of the case.

What are the baker's arguments?

Mr Phillips decided to take the case - known as Masterpiece Cakeshop v Colorado Civil Rights Commission - to the US Supreme Court.

He argues that his cakes are artistic endeavours, and therefore guarantees of freedom of speech and expression in the US constitution protect him from being forced to make creations that express a message he opposes.

His lawyers also say that he did not violate public accommodation laws that ban discrimination because he did not throw the gay couple out of the shop outright and refuse to serve them.

Image copyright Reuters Image caption Jack Phillips has temporarily stopped making wedding cakes

Mr Phillips is represented by Alliance Defending Freedom - a conservative Christian legal group.

The American Civil Liberties Union (ACLU) represents Mr Mullins and Mr Craig.

What ramifications could this have?

A verdict in favour of Mr Phillips could open the door for a number of businesses to invoke religious beliefs and refuse certain services to gay couples.

Legal experts say that businesses could use the case to say they have a similar right to turn way, for instance, interracial couples if this clashes with their religious beliefs.

ACLU lawyer Louise Melling said opposition lawyers were "asking for a constitutional right to discriminate".

"This is not a case about a cake," she told Reuters. "It is a case about a very radical proposition."