LONDON — The Supreme Court of the United Kingdom has reached a unanimous verdict in favor of the right of a Christian-owned bakery not to create a cake in support of same-sex “marriage.” The decision, given Oct. 10, brings an end to a case that began in 2014.

The court found that Ashers bakery did not discriminate against Gareth Lee when it refused an order for a cake with an image of Sesame Street characters Bert and Ernie and the inscription “Support Gay Marriage.”

Writing for the court, Lady Brenda Hale, president of the Supreme Court, determined that support for same-sex “marriage” was a political stance and as such was the subject of the bakery’s objection.

The court found that since support for same-sex “marriage” was not limited to homosexual people, or necessarily determined by one’s sexual orientation, declining to bake a cake with that message could not be seen as an act of discrimination based on the sexual orientation of the person ordering it or those associated with him.

“The objection was to being required to promote the message on the cake. The less favorable treatment was afforded to the message, not to the man,” the court said. “In a nutshell, the objection was to the message and not to any particular person or persons.”

Lee, who is gay, ordered the cake in May 2014. Amy McArthur, who runs the bakery with her husband, Daniel, initially took the order, saying she raised no objection at the time because she wished to consider how to explain her objection and to spare Lee any embarrassment.

Amy McArthur telephoned Lee a few days later and explained that his order could not be fulfilled because they were a Christian business and could not print the slogan requested. She apologized to Lee, and he was given a full refund.

During the hearing of the case, the MacArthurs made it clear that they had served Lee in the past and would happily do so again in the future.

Ashers bakery is named after a biblical reference from Chapter 49 of the Book of Genesis, “Bread from Asher shall be rich, and he shall yield royal dainties.”

Lee was supported by the Equality Commission for Northern Ireland, which believed that Ashers had discriminated on the basis of sexual orientation — a protected class under U.K. law — and Lee’s political beliefs. According to the Supreme Court’s decision, the message to be put on the cake constituted compelled speech for the bakery.

“What matters is that by being required to produce the cake, they were being required to express a message with which they deeply disagreed,” wrote Lady Hale. The court’s decision compared the order, in the context of the bakers’ Christian beliefs, to asking a Christian publisher to print atheist pamphlets.

Lee said that the Supreme Court’s verdict had “implications for all of the gay community” and made him feel like a second-class citizen.

Speaking outside the court in Westminster, Daniel MacArthur said that “I know a lot of people will be glad to hear this ruling today, because this ruling protects freedom of speech and freedom of conscience for everyone.”

Many court-watchers had highlighted similarities in the case to that of Masterpiece Cakeshop v. Colorado Human Rights Commission, decided by the U.S. Supreme Court earlier this year. In a postscript to the decision’s argumentation, Lady Hale underscored the differences between the two cases, noting that in Masterpiece the dispute centered on the event the cake was intended for, a gay wedding, and not an actual message written on it.

Speaking for the Coalition for Marriage, a U.K.-based alliance of both secular and religious groups opposed to the redefinition of marriage by the state, Sharon James said: “This is a great day for commonsense and free speech.”

“The Supreme Court concluded that there was no discrimination on grounds of religious belief or political opinion, no discrimination on grounds of sexual orientation, and this case was about the message, not the messenger,” she said in a statement.

John O’Doherty, director of the Rainbow Alliance, said that while some people might be “sympathetic” to the position in which Ashers found itself, “this does not change the facts of the case. We believe this is direct discrimination for which there can be no justification.”

O’Doherty said his organization, would “take time to study this judgment by the Supreme Court to understand fully its implications for the rights of LGBT people to access goods, facilities and services without discrimination.”

The decision was welcomed by Arlene Foster, leader of the Democratic Unionist Party, a member of the U.K.’s governing coalition and the largest party in Northern Ireland. She told reporters that the ruling was “seminal and historic.”

She paid tribute to the MacArthurs, saying, “I commend Amy and Daniel McArthur for their grace and perseverance. This now provides clarity for people of all faiths and none.”