Britain’s Supreme Court reversed a lower court Wednesday and ruled that a bakery owned by a Christian family didn’t discriminate against a gay customer when it refused to make a cake in 2014 of “Sesame Street” characters Bert and Ernie and the phrase “Support Gay Marriage.”

Ashers Baking Co. in Northern Ireland refused to make the cake iced with the characters after the owners argued they shouldn’t’ be forced to put messages on their products at odds with their Christian beliefs. The high court agreed with the owners. The five justices on the court were “unanimous in their judgment,” the BBC reported.

"In a nutshell, the objection was to the message and not to any particular person or persons," Judge Brenda Hale wrote in the decision. "It is deeply humiliating, and an affront to human dignity, to deny someone a service because of that person's race, gender, disability, sexual orientation or any of the other protected personal characteristics. But that is not what happened in this case."

BRITISH EDITOR IN DUBAI TO SERVE 15 YEARS FOR KILLING WIFE

Daniel McArthur, the general manager of the bakery, said he was relieved by the decision.

"I want to start by thanking God," he told reporters. "He has been with us during the challenges of the last four years."

Gay rights activist Gareth Lee -- the customer in the case -- and the Equality Commission for Northern Ireland brought the argument to court. Lee sued the bakery for “discrimination on the grounds of sexual orientation and political beliefs,” the BBC reported.

Lee said the case “made him feel like a second-class citizen” and he was concerned “about the implications for all of the gay community.”

"To me, this was never about conscience or a statement. All I wanted to do was to order a cake in a shop," he said.

The case received support from the Rainbow Project, Northern Ireland’s largest support organization for lesbian, gay, bisexual and transgender people. The organization expressed disappointment over the decision.

BRITISH MAN TRAPPED IN SHED AS ‘SLAVE’ FOR 40 YEARS, OFFICIALS SAY

"We believe this is direct discrimination for which there can be no justification," director John O'Doherty said. "We will, however, 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 comes just months after the U.S. Supreme Court ruled in favor of a Colorado baker who refused to make a wedding cake for a same-sex couple.

The Associated Press contributed to this report.