Patrick Stewart has defended a bakery, which was found guilty of discrimination for refusing to bake a cake with a pro-gay marriage slogan.

Last month, a judge ruled that Ashers Baking Company in Northern Ireland had discriminated against a gay customer by refusing to make a cake with the words “support gay marriage”, along with a picture of Bert and Ernie from "Sesame Street."

Gareth Lee commissioned the cake for an event to mark International Day Against Homophobia and Transphobia. The bakery initially accepted the order but called Lee two days later to cancel.

Speaking to the BBC’s Newsnight program, Stewart, who starred in the "Star Trek" TV show, said he supported the rights of the bakery to refuse something which they found personally offensive.

“Finally I found myself on the side of the bakers,” he said. “It was not because this was a gay couple they objected, it was not because they were going to be celebrating some kind of marriage, it was the actual words on the cake they objected to, they found them offensive.

“I would support their right to say, ‘No, this is personally offensive to my beliefs, I [will] not do it.’ But I feel bad for them that it cost them [500] quid ($736).”

In handing down her decision, Judge Isobel Brownlie said the refusal not to make the cake was “direct discrimination for which there can be no justification.”

“My finding is that the defendants cancelled this order as they oppose same-sex marriage for the reason that they regard it as sinful and contrary to their genuinely-held religious beliefs,” Judge Brownlie said.

“Same-sex marriage is inextricably linked to sexual relations between same-sex couples, which is a union of persons having a particular sexual orientation. The plaintiff did not share the particular religious and political opinion which confines marriage to heterosexual orientation.

“The defendants are not a religious organization. They are conducting a business for profit and, notwithstanding their genuine religious beliefs, there are no exceptions available under the 2006 regulations which apply to this case.”

The McArthur family was fined £500, which Lee said he would donate to charity, but the McArthurs said they would appeal the decision.

At the time, Ashers general manager Daniel McArthur said he was “extremely disappointed” with the judgement.

“Our issue was with the message on the cake, not with the customer, and we didn’t know what the sexual orientation of Mr. Lee was, and it wasn’t relevant either,” he said.

“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.”

He told The Independent the company didn’t want to be forced to promote a cause which was against their Christian beliefs.

“We’ve had a lot of support from people who disagree with our stance on same-sex marriage. They think that we should have the freedom to decline an order that conflicts with our conscience.”

The case followed another cake incident in January, when a U.S. woman was taken to court for refusing to write “God hates gays” on a bible-shaped cake for a customer.

Marjorie Silva, the owner of Denver’s Azucar Bakery, faced the complaint from a customer alleging she discriminated against his religious beliefs.

And last year, a U.S. Civil Rights Commission upheld a discrimination case against baker who had refused to make wedding cakes for same-sex couples.

This article originally appeared on News.com.au.