WASHINGTON — President Trump seized on a terrorist attack in London on Friday to promote his ban on travel to the United States by Muslims and, in the process, ran afoul of Britain by claiming without evidence that the assailants had been “in the sights” of the British police.

In a fusillade of early morning tweets, Mr. Trump cited the chaotic scene in a London Underground station as Exhibit A for his hard-line policies. His ban on visitors from predominantly Muslim countries, he wrote, should be “far larger, tougher and more specific” — a statement that seemed calculated to mollify his political base after a week in which Mr. Trump suddenly began playing dealmaker with Democrats on immigration.

But Mr. Trump’s assertion that the assailants had been known to Scotland Yard angered Prime Minister Theresa May, who said it was not helpful for anyone to speculate while an investigation was underway. Mr. Trump was later briefed about the attack and called Mrs. May with condolences, according to a senior official, though he did not apologize.

It was the latest episode in which Mr. Trump was at odds with Britain over sensitive security issues. In June, he criticized London’s mayor, Sadiq Khan, over his response to another terrorist attack, misconstruing Mr. Khan’s words. In March, the White House press secretary at the time, Sean Spicer, repeated allegations that a British intelligence agency had wiretapped Trump Tower, which British authorities dismissed as “utterly ridiculous.”