Transport for London (TfL) has welcomed a Court of Appeal ruling in favour of the 2012 decision to ban anti-gay adverts on London’s buses.

The court on Monday upheld TfL’s original decision and right not to run “ex-gay” adverts by the Core Issues Trust, a Christian evangelical charity.

However, the Master of the Rolls, Lord Dyson, criticised the decision-making process by the office of the Mayor of London, Boris Johnson.

He ruled that a judicial investigation was needed to consider whether Mr Johnson had acted “for an improper purpose”.

Lord Dyson said evidence had been produced of “an email which unequivocally states that the mayor ‘instructed’ TfL to pull the advertisement,” just before London went to the polls.

Reacting to the ruling, TfL noted how the judge agreed that the adverts were offensive, saying “the restrictions are justified in view of the prominence of the advertisements and the fact that they would be seen by, and cause offence to, large numbers of the public in central London.”

Lord Dyson said “that the advertisement is liable to encourage homophobic views and homophobia places gays at risk”.

He ruled that it broke numerous parts of the UK’s Equality Act 2010 and the European Convention on Human Rights.

“Transport for London today welcomed the Court of Appeal’s decision to uphold TfL’s original decision and right not to run ‘gay cure’ adverts by the Core Issues Trust, The Appeal Court upheld the original decision by Mrs Justice Lang that TfL was entitled not to run the advert,” the organisation said in a statement.

“TfL took the decision not to run the adverts as they breached its advertising policy and caused 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.”