President Trump said late Thursday that he had canceled a trip to London because of the cost and “off location” of the new United States Embassy in the city, where he had been expected to face protests.
Nearly a year ago, Mr. Trump accepted an invitation to visit from Queen Elizabeth II, which was extended by Prime Minister Theresa May of Britain while she was in Washington shortly after Mr. Trump’s inauguration.
That announcement set off a year of debate in Britain, where Mr. Trump is unpopular, and the timing of the visit was continually pushed back. British newspapers cited concerns about protests during a visit as officials tried to gauge how much pomp should greet Mr. Trump.
Last month the United States ambassador to Britain, Woody Johnson, said that while no trip had been formally announced, he hoped Mr. Trump would visit in early 2018 and dedicate the new embassy.
On Thursday night, the president took to his favorite medium, Twitter, and announced that he had canceled his trip because he was unhappy with the new building.
Mr. Trump’s British critics responded with jeers, saying the president was afraid of the reception he would get in Britain.
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.