A judge has ruled that a Christian-run bakery discriminated against a gay customer by refusing to make a cake with a pro-gay marriage slogan.
Ashers Baking Company, based in County Antrim, was taken to court by gay rights activist Gareth Lee.
A Belfast judge said, as a business, Ashers was not exempt from discrimination law.
The firm's general manager said they were "extremely disappointed" by the ruling and are considering an appeal.
Damages of £500 were agreed in advance by legal teams on both sides of the dispute.
A lawyer for Mr Lee said the money would be donated to charity.
The judge said Ashers is "conducting a business for profit", and it is not a religious group.
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.
Analysis: Caroline Wyatt, BBC religious affairs correspondent
This case has highlighted once again the continuing tensions in the UK between equality law and freedom of conscience for those whose religious beliefs don't allow them to accept same-sex marriage.
Christian Concern, which backs Christians facing court cases over their beliefs, says the judgement undermines religious freedom in Northern Ireland, while the Evangelical Alliance claims that this is a significant change in the law that will have wider implications and may even suggest that religion has been "effectively banished from the commercial sphere".
During the election campaign, UKIP proposed the idea of a conscience clause to be added into equality law. After the cake case first became public, the Democratic Unionist Party also suggested allowing individuals and businesses an exclusion from discrimination law so that they could - legally - refuse to provide services that went against their religious convictions. However, critics opposed the idea as a "charter for discrimination".
Baroness Hale of Richmond, the deputy president of the UK's Supreme Court, has said she is not convinced the law had found a way to strike a "reasonable" balance between accommodating people's right to follow their beliefs while protecting others from discrimination.
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. 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."
John O'Doherty, of gay rights group the Rainbow Project, said: "While sympathetic as some may be to the position in which the company finds itself, this does not change the facts of the case.
"The judge clearly articulated that this is direct discrimination for which there can be no justification."
However, DUP MLA Paul Givan, who has proposed that lawmakers in the Northern Ireland Assembly introduce a "conscience clause" as a result of the Ashers case, said many Christians would view the ruling as "an attack" on their religious convictions.
"What we cannot have is a hierarchy of rights, and today there's a clear hierarchy being established that gay rights are more important than the rights of people to hold religious beliefs," Mr Givan added.