A Christian bakery has lost its appeal against being found to have unlawfully refused to make a cake with a pro-gay marriage slogan.
In a landmark verdict, senior judges in Belfast ruled that the McArthur family did directly discriminate against customer Gareth Lee due to his sexuality.
Lord Chief Justice Sir Declan Morgan said: "What they may not do is provide a service that only reflects their own political or religious message in relation to sexual orientation.
Ashers' Baking Company, run by the McArthurs, declined an order placed by Mr Lee at its Belfast city centre shop in May 2014.
The gay rights activist had requested a cake depicting Sesame Street characters Bert and Ernie below the motto 'Support Gay Marriage' for an event to mark International Day Against Homophobia.
Bosses at the bakery refunded his money for the order because the message went against their Christian faith.
The family insist their problem was with the cake and not the customer.
But Mr Lee sued, claiming he was left feeling like a lesser person.
Last year Belfast County Court held that the bakery had unlawfully discriminated against him on grounds of sexual orientation and religious belief or political opinion.
The firm was also ordered to pay £500 compensation to Mr Lee, whose legal action was backed by the Equality Commission.
But during a four-day hearing at the Court of Appeal lawyers for the McArthurs argued it would have been sinful for them to complete the order.
Counsel for the family claimed it was wrong to force them to choose between operating a business or adhering to their faith.
Rejecting allegations that the bakery subjected Mr Lee to direct discrimination, he insisted the refusal was solely due to conscience and nothing to do with the customer or his political opinion.
Anyone else asking for the same cake would have received the same response due to the family's religious beliefs, the court heard.
Northern Ireland's top law officer, Attorney General John Larkin QC, backed the McArthurs' case by contending that forcing them to complete the order could amount to cruelty.
Attorney General John Larkin QC submitted that it was wrong to force them to express a political view in conflict with their faith, adding that they should have constitutional protection.
Counsel representing the Equality Commission argued that the family's entitlement to express religious beliefs should not "trump" Mr Lee's rights.
He told the court that the bakery's objection to using the word gay meant there was direct discrimination.
Backing that position, Sir Declan, sitting with Lord Justices Weatherup and Weir, pointed out that the McArthurs had not been asked to support gay marriage.
"The fact that a baker provides a cake for a particular team or portrays witches on a Halloween cake does not indicate any support for either," he added.
Mr Lee and the McArthur family were present in a packed courtroom for the ruling.
The Lord Chief Justice said the reason the order was cancelled was that the appellants would not provide a cake with a message endorsing a right to marry for those of a particular sexual orientation.
"This was a case of association with the gay and bisexual community an the protected personal characteristic was the sexual orientation of that community," he added.
"Accordingly this was direct discrimination."
The legislation does not treat the company less favourably, the court heard.
Sir Declan held: "The answer is for the supplier of services to cease distinguishing, on prohibited grounds, between those who may or may not receive the service.
"Thus the supplier may provide the particular service to all or none, but not to a selection of customers based on prohibited grounds."
The Equality Commission is now to seek its legal costs in the case.
Outside court Daniel McArthur claimed equality law needs to change if it means facing punishment for politely refusing the support the views of others.
"This ruling undermines democratic freedom, religious freedom and free speech," he said.
Mr McArthur insisted his bakery has served Mr Lee before and would be happy to do so again in future.
But re-emphasising the difficulty was with the slogan, he said requests to decorate a cake with pornographic images, swear words or even spiteful messages about gay people would also be refused.
Mr McArthur added: "We will have to take advice from out lawyers about whether there's a way to appeal this ruling."