Ashers Baking Company declined an order from a gay rights activist, asking for cake featuring the Sesame Street puppets, Bert and Ernie.
The customer also wanted the cake to feature the logo of a Belfast-based campaign group called "Queerspace". They also wanted the cake to say 'Gay Marriage' which is not yet lawful in Northern Ireland.
|What the cake was to look like|
The County Antrim firm could face legal action from the Equality Commission.
The watchdog confirmed it is assisting the customer whose order was refused and has written to the baking company on his behalf.
The cake was ordered for a civic event in Bangor Castle Town Hall, County Down, to mark International Day Against Homophobia and Transphobia.
The bakery, which was founded in Newtownabbey in 1992, is run by the McArthur family.
The directors, who are Christians, operate six shops in Northern Ireland and employ 62 people.
The firm's 24-year-old general manager, Daniel McArthur, said marriage in Northern Ireland "still is defined as being a union between one man and one woman" and said his company was taking "a stand".
The customer placed the order in Ashers' Belfast branch a number of weeks ago, and it was then passed to their head office.
In an online statement, Mr McArthur said: "The directors and myself looked at it and considered it and thought that this order was at odds with our beliefs.
"It certainly was at odds with what the Bible teaches, and on the following Monday we rang the customer to let him know that we couldn't take his order."
Mr McArthur added that his firm offered the customer a full refund, which was collected shortly after the order was refused.
"We thought that was the end of it, but approximately six weeks later we received a letter from the Equality Commission. The Equality Commission's letter said that we had discriminated against the customer on the grounds of his sexual orientation. Of course, this is a twisting of the facts; the bakery did not refuse to do the cake because the man who ordered it was gay, but because of what he wanted on the cake.
A Christian cannot separate what he does from God. God, the Holy Spirit indwells a Christian at all times. For a Christian to assist in any way in the celebration of what is very clearly offensive to God, requires the Christian to offend God. For the government to order him to offend God is unthinkable.
"It asked us to propose how we would recompense the customer for this discrimination. It also said it would pursue legal proceedings if we didn't respond within a seven-day time period," Mr McArthur said.
The general manager said he was "very surprised" by the watchdog's letter and his firm asked the Christian Institute for advice on how to deal with the case.
The institute is supporting the bakery's stance and is now providing legal assistance.
Mr McArthur said: "I feel if we don't take a stand on this here case, then how can we stand up against it, further down the line?"
The general manager added that it was not the first time his company had refused customers' cake orders.
"In the past, we've declined several orders which have contained pornographic images and offensive, foul language." Again, the order was declined because of what the customers wanted on the cakes not because the customer was a foul-mouthed pervert.
Mr McArthur added: "I would like the outcome of this to be that, any Christians running a business could be allowed to follow their Christian beliefs and principles in the day-to-day running of their business and that they are allowed to make decisions based on that."
However, Alliance councillor Andrew Muir - who hosted the civic event for which the cake was ordered - said he fully supported the action taken against the bakery.
"Businesses should not be able to pick and choose who they serve," Mr Muir said.
"There would not be any debate if the cake had depicted an anti-racism or anti-ageism slogan, nor should it require intervention from the Equality Commission for this cake for Anti-Homophobia Day.
"It is ridiculous for this bakery to suggest that they would have to endorse the campaign."
The councillor, who hosted the event during his term as mayor of North Down, said another bakery in Bangor stepped in and accepted the cake order.
But Mr Muir added: "For Northern Ireland to prosper and overcome our divisions we need a new society where businesses are willing to cater for all, regardless of religious views, political opinion, disability, race, age, sexual orientation, marital status, gender and other backgrounds." That's a laudable idea in an ideal world, but will never happen in a sin-filled, anti-Christian world.
Gavin Boyd, a gay rights campaigner with the Rainbow Project in Northern Ireland, also supported the customer's discrimination complaint.
Rainbow Project's Gavin Boyd said the issue was not about same sex marriage but the provision of goods, facilities and services.
"It is because of sexual orientation that the company decided not to print this," Mr Boyd told BBC Radio Ulster. I guess I missed something here, print what? Do they make cakes with 3-D printers now?
"The law is really clear. You cannot pick and choose which sides of the law apply to you. God is also very clear, "Choose you this day whom you will serve".
"If you are a company that is trading out there in the market place and someone comes to you, you can't pick and choose whether or not to fulfil that order based on their sexual orientation," Mr Boyd added.
But the Democratic Unionist Party (DUP) said the Equality Commission had overstepped the mark and the complaint highlighted the need for a "conscience clause" to protect Christians and others who have deeply held beliefs.
DUP MP Nigel Dodds said: "The case re-opens the debate about how exactly religious belief is respected within the United Kingdom and the need for someone's conscience to be protected whilst ensuring that discrimination does not occur."
In a statement, the watchdog said: "The Equality Commission for Northern Ireland provides advice and can provide assistance to people who complain to us that they have suffered unlawful discrimination.
"In this case the commission has granted assistance to the complainant, and has written to the company concerned on his behalf.
"The commission will consider any response before taking further action."
Northern Ireland is now the only part of the UK which has not passed a law to introduce same-sex marriage.