The High Court said TfL was acted lawfully in banning the proposed advert because it would “cause grave offence” to gay people. The judge also said the adverts would “increase the risk of prejudice and homophobic attacks”.

The posters, which were sponsored by the Christian charity Core Issues Trust, read: “Not Gay! Ex-Gay, Post-Gay and Proud. Get over it!”

They were created in response to a bus poster campaign by Stonewall, which is a gay-rights group. Stonewall’s posters read: “Some people are gay. Get over it!”

However, the court said TfL’s process in introducing the ban was “procedurally unfair and demonstrated a failure to consider the relevant issues”.

Core Issues Trust took TfL to court and contested the ban by saying mayor’s decision was politically driven because it was made close to last year’s mayoral elections.

At the time of the ban, Johnson said the “gay cure” advert could lead to retaliation against the wider Christian community.

The judge ruled Boris Johnson did not abuse his position as TfL chairman in imposing the ban.

Following the ruling a TfL spokesperson said “The advertisement clearly breached our advertising policy as it contained a controversial message and was likely to cause widespread offence to the public.

“This was borne out by the hugely negative public reaction the advertisement generated, including on social media and newspaper websites.

“We are taking steps to address the Judge’s comments regarding our internal processes”.

The judge permitted Core Issues to appeal to the Court of Appeal, but said she did not think it would succeed.

Gay rights group Stonewall chief Ben Summerskill said: “Many people will be pleased by today’s decision.

“In a city where over half of gay young people face bullying at school, and where tens of thousands of gay people are subjected to hate crimes every year just because of the way they were born, it’s perfectly proper for a mayor to object to the use of such advertising in an iconic public setting”.

Images via Getty