Mr Johnson said the ads by the Core Issues Trust were offensive to gays, and said they could even spark retaliation against the wider Christian community.

The posters said “Not Gay! Ex-Gay, Post-Gay and Proud. Get over it!” and was in response to a previous poster campaign by Stonewall, the gay rights group, which said: “Some people are gay. Get over it!”

Mr Johnson’s role puts him in charge of Transport for London, which is responsible for approving advertising on buses in the city.

On Thursday Dr Mike Davidson, the head of the trust, and his supporters will go to the High Court to claim Mr Johnson’s ban on their poster campaign should be reversed on the grounds that he unlawfully stifled free speech.

They are bringing a judicial review and Dr Davidson is hoping Transport for London (TfL) will be forced to accept the advertisements.

They argue that other advertising campaigns - including Stonewall’s, and campaigns for underwear - have been allowed TfL.

“This is all about being free to talk about these issues,” said Dr Davidson, who himself has a homosexual past, but has been attracted controversy for suggesting gays can become heterosexual through counselling and prayer.

“It was a mistake to assume these views we were expressing came from entrenched homophobia, and failed to recognise that people who want to walk away from their homosexual feelings are a group in their own right.”

He has instructed Paul Diamond, the human rights barrister, in this week’s case.

Stifling debate by banning their advert amounted to discrimination, the trust will argue.

They will point in particular to one poster which some Christians found offensive. Funded by Richard Dawkins, the academic, and the British Humanist Association in 2009, it said: “There’s probably no God. Now stop worrying. And enjoy your life.”

Andrea Williams, director of the Christian Legal Centre, which is supporting Dr Davidson’s case, said: “The ban on these advertisements was the beginning of a kind of reverse discrimination which threatens to obliterate debate in the public sphere.

“Boris Johnson needs to realise his mistake and ensure there is freedom for all in the marketplace of ideas. He cannot prefer one group over another.”

A Transport for London spokesman said: “The advertisement breached TfL’s advertising policy as in our view it contained a publicly controversial message and was likely to cause widespread offence to members of the public.”