The latest contretemps came when Mr. Trump heaped scorn on Mayor Sadiq Khan of London. “At least 7 dead and 48 wounded in terror attack and Mayor of London says there is ‘no reason to be alarmed!’” Mr. Trump wrote on Twitter.

Mr. Trump either misunderstood what Mr. Khan had said or distorted it. During an interview shown on the BBC, the mayor said he was “appalled and furious that these cowardly terrorists would target” innocent civilians and vowed that “we will never let them win, nor will we allow them to cower our city.”

He went on to say that residents should not worry as they encounter more police officers patrolling the streets.

“Londoners will see an increased police presence today and over the course of the next few days,” Mr. Khan said. “No reason to be alarmed. One of the things the police, all of us, need to do is make sure we’re as safe as we possibly can be. I’m reassured that we are one of the safest global cities in the world, if not the safest global city in the world, but we always evolve and review ways to make sure that we remain as safe as we possibly can.”

Mr. Khan’s office later dismissed Mr. Trump’s post, saying the mayor was too busy to reply. “He has more important things to do than respond to Donald Trump’s ill-informed tweet that deliberately takes out of context his remarks urging Londoners not to be alarmed when they saw more police — including armed officers — on the streets,” his office said in a statement.