The Christian owners of a bakery have won an appeal at the UK's highest court over a finding that they discriminated against a customer by refusing to make a cake decorated with the words "Support Gay Marriage".

Five Supreme Court justices allowed a challenge by the McArthur family in a unanimous ruling in London on Wednesday in what has become widely known as the "gay cake case".

The legal action was originally brought against family-run Ashers bakery in Belfast by gay rights activist Gareth Lee, who won his case initially in the county court and then at the Northern Ireland Court of Appeal.

Announcing the court's decision, its president, Lady Hale, said: "This conclusion is not in any way to diminish the need to protect gay people and people who support gay marriage from discrimination.

"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, religion or belief.

"But that is not what happened in this case."

She went on: "As to Mr Lee's claim based on sexual discrimination, the bakers did not refuse to fulfil his order because of his sexual orientation.

"They would have refused to make such a cake for any customer, irrespective of their sexual orientation."