Last September I visited Chicago and New York on my first overseas trip as Mayor of London. I went to strengthen the economic ties between our great global cities, to discuss shared challenges with two great mayors in Rahm Emanuel and Bill de Blasio, and to show the world that London remains open to business, people and ideas in the aftermath of the EU referendum.

While I was in the US I was asked about the presidential election and I made my views clear: I wanted to see Hillary Clinton elected as the first women president — to be a role model for my teenage daughters and for millions of girls around the world. I was also deeply concerned about Donald Trump’s divisive campaign — and his targeting of some people for no reason other than their faith or their country of birth.

However, Trump won the election. And I’ve done my best to avoid criticising him since the election on November 8 — out of respect for the democratic will of the people of the US and in the hope that President Trump would govern more moderately and sensibly than he campaigned.

However, in the aftermath of his shameful and cruel ban on immigrants and refugees from certain countries this week — which will affect millions around the world — I have no choice but to speak out.

Every country has the right to set its own immigration policies but this ban is both discriminatory and counter-productive.

It will see the US turn its back on its obligation to refugees fleeing from violence and persecution — and it will play straight into the hands of the terrorists and extremists who seek to divide and harm our great nations. I fear it will be used to act as a recruiting sergeant for so-called IS and other like-minded groups.

Until a clarification obtained from the US State Department last night after diplomatic work by my predecessor as mayor, Boris Johnson, now the Foreign Secretary, it appeared that both the Iraqi-born Conservative MP, Nadhim Zahawi, would be banned from the US, as would the four-time Olympic gold medallist Sir Mo Farah, a dual national of Britain and Somalia.

The clarification means that UK citizens who are dual nationals of countries named in President Trump’s ban will not be stopped from going to the US unless they travel directly from one of the countries affected. This also appears to apply to dual nationals from other countries.

But we should not kid ourselves that this makes everything all right. Far from it. Millions of people still face a ban from going to the US simply because of where they come from.

It also means that many green card holders — people who have lived and worked in the US for years — are now banned from their home country.

The self-defeating nature of the ban is shown by examining how poorer — in every sense of the word — the US would be if it had been in place years ago.

To give just two high-profile examples: Steve Jobs, the founder of Apple who died in 2011, was the son of an immigrant who came to the US from Syria in the Fifties. The eBay founder Pierre Omidyar is the child of Iranian parents.

Donald Trump’s ban also sees the US turning its back on the global refugee crisis. This can only be tackled if all the nations of the world play their part and work together.

As of December last month 65.3 million people around the world were displaced from their home as a result of war or persecution — and that number is increasing faster than ever before. One in every 113 people in the world is a refugee.

I fear this policy will make both the US and Britain less safe in the long run

No one nation or even continent can manage this alone. We all need to do more — including London and Britain — and now is not the time for the great nations of the world simply to turn their backs and walk away.

Worst of all, I fear this policy will make both the US and Britain less safe in the long run. It plays straight into the evil hands of Islamic State and other terrorists and extremists, who are trying to convince desperate young people across the world that Islam and the West are incompatible, that we are somehow their enemy.

Our job is to show just how wrong they are — to prove that Muslims can succeed, flourish and practise their religion freely and peacefully in the West.

I’m relieved that the Prime Minister, Theresa May, has finally seen sense and joined the worldwide criticism of this ban. I will work closely with the Government to help and support every Londoner that has been affected.

But by rushing to Washington, standing squarely with President Trump and being slow to speak out, the Prime Minister could be accused — not unfairly — of not doing enough to call out the dangerous and divisive attitude of the new regime in Washington.

The UK-US alliance is rightly known as “the special relationship”.

Our nations not only share a long and great history but an absolute respect for the values of freedom, democracy, tolerance and diversity. Britain and the US have so much in common — they are seen the world over as beacons of freedom and liberty. But over these past few days something on the other side of the Atlantic changed.

Great friends must warn each other when they are making a mistake. It’s the mark of a genuine mature relationship

The Prime Minister must be clear with President Trump that his actions are unacceptable for a liberal, open democracy. And we should not be seen to be endorsing them.

That is why we must now rescind the offer of a full state visit for President Trump — until this ban is lifted. I don’t believe the people of London will support rolling out the red carpet until this happens.

Great friends must warn each other when they are making a mistake. It’s the mark of a genuine mature relationship.

And we in Britain have an obligation and a responsibility to make crystal clear to President Trump that this ban is a mistake — and to urge him to put it right.