Ashers Baking Company, based in County Antrim, was taken to court by gay rights activist Gareth Lee.
A Belfast judge said that, as a business, Ashers was not exempt from discrimination law but the firm’s general manager said they were “extremely disappointed” by the ruling and are considering an appeal.
The BBC reports that damages of £500 were agreed in advance by legal teams on both sides of the dispute and a lawyer for Mr Lee said the money would be donated to charity.
The firm was found to have discriminated against Mr Lee on the grounds of sexual orientation as well as his political beliefs.
The judge said she accepted that Ashers has “genuine and deeply held” religious views, but said the business was not above the law.
Mr Lee was assisted in taking legal action by the Equality Commission for Northern Ireland. Speaking outside Belfast County Court after the ruling, Ashers general manager Daniel McArthur said his company was “extremely disappointed with the judgment”.
“We’ve said from the start that our issue was with the message on the cake, not with the customer and that we didn’t know what the sexual orientation of Mr Lee was, and it wasn’t relevant either. We’ve always been happy to serve any customers who come into our shops.
“The ruling suggests that all business owners will have to be willing to promote any cause or campaign, no matter how much they disagree with it.”
Mr McArthur said he did not believe his bakery had done anything wrong and would be taking further legal advice after the ruling.
The chief commissioner of the Equality Commission, Michael Wardlow, said the ruling had “vindicated” both his organisation’s decision to support Mr Lee’s case and the need for the watchdog itself “to be in existence”.
“We started off by saying that we believed that there had been a discriminatory act,” he said. “The judge has upheld it – that both under sexual orientation regulations, political and religious opinion, that there were discriminatory acts.”
Mr Wardlow added: “We’re here to help people who otherwise couldn’t help themselves and in this particular case it’s clear that Gareth was discriminated against, the judge has made that clear.”
Reacting to the decision, Northern Ireland Deputy First Minister Martin McGuinness tweeted: “Ashers bakery judgement a good result for equality, gay people have for far too long been discriminated against. We and the law on their side.”