Meeting in Parliament, lawmakers were unanimous in saying Mr. Trump, by giving a platform to the fringe group Britain First, had gone too far.
The chorus began after Stephen Doughty, a Labour lawmaker from Wales and the grandson of an American G.I. who came to Britain in 1944 to fight Germany, used a parliamentary maneuver to call an urgent debate on “Britain First, online hate speech and the sharing of inflammatory content online by the president of the United States, Donald Trump.”
The government minister present, Amber Rudd, the home secretary, made no attempt to defend Mr. Trump, though she observed that sharing intelligence with the Americans “has undoubtedly saved British lives.”
Members of the opposition Labour Party had been among the first to pounce on Mr. Trump’s tweets, but they were joined on Thursday by several members of Mrs. May’s Conservative Party.
One of them, Peter Bone, called on Mrs. May to persuade Mr. Trump to delete his Twitter account. Another, Tim Loughton, urged Twitter to take down Mr. Trump’s account “as it would that of any other citizen of the world who peddled such hate.”
A third Conservative lawmaker, Paul Masterton, lamented: “Just because somebody stops using Twitter, it does not mean that they cease to be a twit.”
Remarkably, a Parliament that in February debated whether to deny Mr. Trump a state visit because, among other reasons, it could embarrass Queen Elizabeth II, found itself taking on that question once again.
For Mrs. May, the episode has been simultaneously an embarrassment, a diplomatic setback and a lesson in just how hard it is to manage her relationship with Mr. Trump, a leader she has tried hard to cultivate.
Britons pride themselves on their “special relationship” with the United States and, this week, basked in the announcement of the engagement of Prince Harry to the American Meghan Markle.
But by the middle of the week Mr. Trump had knocked news of the royal wedding off the front pages, replacing it with a renewed discussion of whether a state visit to Britain should be scrapped.
Mr. Khan — the London mayor who was involved in a separate dispute with Mr. Trump after a terrorist attack in his city — suggested on Twitter that the president should not be invited for any official visit to Britain, let alone one with full pomp and ceremony.
And in the House of Commons, a Labour lawmaker, Paul Flynn, argued that Mr. Trump should be arrested for incitement to racial hatred if he set foot in Britain.
Criticism swelled well beyond Parliament, encompassing figures such as the comedian John Cleese, and Brendan Cox, the husband of the Labour lawmaker, Jo Cox, who was murdered by a right-wing extremist last year.
In Britain, ministers sought to contain the diplomatic impact of the episode, emphasizing the importance of the close security and intelligence relationship between the two countries. Nevertheless, Britain’s ambassador in the United States, Kim Darroch, wrote on Twitter that he had raised concerns with the White House.
The controversy followed Mrs. May to Jordan. On an official visit there, she sought to thread the needle, criticizing Mr. Trump but maintaining that his state visit would go ahead.
“I am very clear that retweeting from Britain First was the wrong thing to do,” she said at a news conference, adding: “The invitation for a state visit has been extended, and has been accepted. We have yet to set a date.”
On Thursday evening, a White House official said that no visit to Britain was “currently on the books,” but added that American officials were working with their British counterparts to arrange one.
That invitation to Mr. Trump was unusual in that it was extended soon after his inauguration. A state visit is an honor normally offered much later in a presidency. More than 1.8 million people signed a petition against a visit, and opponents promised protests if one were to take place.
Even before the latest uproar, there was speculation that the state visit was being pushed into the long grass. Instead, it was said, Mr. Trump was likely to make a brief, less formal visit, perhaps to coincide with the opening of the new United States Embassy building in London. Even this may now be threatened.
For Mrs. May, whose government has suffered two recent cabinet resignations, the dispute is another unexpected headache. She has to manage the anger provoked by Mr. Trump at home, including that expressed by a Muslim member of her own cabinet, Sajid Javid, who tweeted a strong condemnation on Wednesday of Mr. Trump’s decision to share the videos.
Yet with Britain scheduled to quit the European Union in 2019, Mrs. May is hoping to strike an early trade deal with Washington to compensate for a probable reduction in British access to markets in continental Europe.
The position Mrs. May finds herself in with Mr. Trump, while uncomfortable, is not unfamiliar. Former Prime Minister Tony Blair discovered that tying his fortunes too closely to those of a conservative American president could be costly. His relationship with George W. Bush, and his decision to support the invasion of Iraq, effectively wrecked Mr. Blair’s political reputation in Britain.
On many issues, Mrs. May has found Mr. Trump an awkward counterpart, and discovered that her government is much closer to the European Union’s positions than to those of the United States on a range of foreign policy questions, particularly on climate change and relations with Iran.
In contrast, the French president, Emmanuel Macron, has managed to keep a distance from the United States on policy issues while also hosting Mr. Trump on a successful visit to Paris.