Lord Justice Laws condemned any attempt to protect believers who take a stand on matters of conscience under the law as “irrational” and “capricious”.

In comments likely to set the church on a collision course with the courts, he claimed that doing so could set Britain on the road to a “theocracy”, or religious rule.

His comments came as he dismissed a legal challenge by a Christian relationship counsellor who was sacked after refusing to offer sex therapy sessions to homosexual couples because it was against his beliefs.

Gary McFarlane, 48, challenged his dismissal at the Court of Appeal, arguing that forcing him to go against what he sees as the Bible’s teaching represented religious discrimination.

He was supported in his case by a highly unusual direct intervention Lord Carey, the former Archbishop of Canterbury, who wrote to the judge warning of a tide of discrimination against Christians that threatened “civil unrest”.