Ed Miliband, the former Labour Party leader, responded to Mr. Trump’s announcement on Twitter, saying: “Nope. It’s because nobody wanted you to come. And you got the message.”
Sadiq Khan, the mayor of London, said the president’s tweet made clear that it had been a mistake for Mrs. May to move so quickly to extend the invitation to Mr. Trump last year. “It appears that President Trump got the message from the many Londoners who love and admire America and Americans but find his policies and actions the polar opposite of our city’s values of inclusion, diversity and tolerance,” he tweeted.
The old United States Embassy, in a historic square in the exclusive Mayfair neighborhood, was deemed to be vulnerable to terrorist attacks. The new one is in a former rail yard on the South Bank of the Thames. Mr. Trump blamed the Obama administration for the move, accusing it of selling the old embassy for “peanuts” in a “bad deal.”
But the move was actually initiated during the administration of President George W. Bush. “This has been a long and careful process,” Robert Tuttle, then the ambassador to Britain, said in October 2008.
The Trump presidency has complicated the normally close ties between the United States and Britain, which has often been called the “special relationship” since Winston Churchill used the phrase in a 1946 speech.
Mr. Trump has used terrorist attacks in London to support his travel ban on visitors from predominantly Muslim countries. He criticized Mr. Khan for his response to a bombing in June, misconstruing a call for calm as lack of concern about terrorist threats. And his tweets about a bombing in London in September suggested that the police had been monitoring attackers but done nothing.
His retweets of a far-right group’s anti-Muslim videos in November stirred criticism from across the political spectrum in Britain.
Mrs. May had been placed in an awkward situation, as Mr. Trump’s unpopularity in Britain prompted calls that she stand up to the president or even call off his visit. At the same time, her government is in the midst of complicated negotiations to withdraw from the European Union and under pressure to prevent relations with the White House from deteriorating further.
Boris Johnson, the British foreign minister, said last week that it would be a mistake to uninvite Mr. Trump, as one member of Parliament suggested.
“I think Her Majesty the Queen is well capable of taking this American president — or indeed any American president — in her stride, as she has done over six remarkable decades,” Mr. Johnson said.