Sadiq Khan, the first Muslim mayor of a western capital city, is no stranger to making powerful enemies, and few come as mighty and ill-tempered as Donald Trump. The mayor of London and the US president have clashed several times – spats that appeared engineered by Trump to show who’s boss. Khan has not flinched, chastising and ridiculing Trump with apparent relish.

News that the 46-year-old son of a Pakistani bus driver was taking on Uber would have surprised few seasoned Khan-watchers. His 15 months as mayor of a London navigating one of the most tumultuous periods of its modern history have left him battle-hardened rather than bowed.

In recent months, London has endured a spate of terrorist attacks, the most recent a week ago, and a serious fire in a block of flats that killed almost 80 people – all against the backdrop of the city’s painful extraction from the EU, an act that that presents an existential threat to its economy and identity.

Khan has emerged with his integrity and popularity intact, unlike his predecessor Boris Johnson, now foreign secretary, whose posh schoolboy goofishness divided Londoners.

Khan’s willingness to make Uber “play by the rules” is merely the latest example of his eagerness to take on wealthy corporations and the rich, having made considerable political capital on populist issues such as the injustice of foreign ownership and ghost mansions.

Earlier this month, Khan made leaders of other wealthy cities experiencing a lack of affordable homes take notice by appealing for powers to hike up taxes for high-value homes left empty by the international elite.

But in the US it is Khan’s run-ins with Trump that have garnered most attention. After the July attacks on London Bridge and the city’s Borough market, the US president tweeted: “At least seven dead and 48 wounded in terror attack and Mayor of London says there is ‘no reason to be alarmed’!”

At least 7 dead and 48 wounded in terror attack and Mayor of London says there is "no reason to be alarmed!" — Donald J. Trump (@realDonaldTrump) June 4, 2017

Trump, in his seeming haste to point fingers, had got the context wrong. Khan, who joined the Labour party aged 15, had merely said the public should not be perturbed by the increased police presence on London’s streets.

Undeterred, Trump followed up with another tweet, that this was a “pathetic excuse” that the mainstream media “is working hard to sell”. Khan’s response, very clearly designed to hurt Trump, went beyond words. The London mayor called on the British government to cancel a planned state visit by Trump, twisting the knife by also claiming “his policies go against everything we stand for”.

Since then Khan has preferred to dismiss the US president as juvenile. “We’re not schoolchildren. He’s the president of the United States, so I’m unclear what his beef is with me,” he told the Guardian in July.

The beef, say some, is because of Khan’s religion. Londoners, though, have no such reservations. Some recent polls have shown Khan to be one of the most popular politicians in the country.

And it is Khan’s background that advocates say most obviously articulates the hopeful possibilities of the city he represents: his humble beginnings in Tooting, south London, his family tree and subsequent rise. Supporters say his journey reflects the determination and decisiveness in his approach to politics and action against Uber.

Such decisions raise his international profile, another step on what some see as a march toward the Labour leadership and becoming Britain’s first Muslim prime minister. Trump’s response to such an eventuality might prove less than charitable.