Many Londoners suggested the real reason he is not coming is because he is concerned about hostile demonstrations.
Sadiq Khan, the mayor of London, said a visit would spark "mass peaceful protests." Trump is not welcome in London while he pursues a "divisive agenda," Khan tweeted, and "it seems he's finally got that message."
But at least one prominent British cabinet official took no part in the gloating. Foreign Secretary Boris Johnson, a former mayor of London, accused Khan and Labour Party leader Jeremy Corbyn of endangering the "crucial relationship" between the United States and Britain. He also called Khan a "puffed up pompous popinjay."
The White House had not formally announced the visit Trump said he had canceled, but the president was widely expected to attend a ceremony next month to dedicate the new embassy. Robert "Woody" Johnson, the U.S. ambassador to Britain and a friend of Trump's, told the BBC last month he was optimistic about a visit in the new year.
Unlike other European leaders, British Prime Minister Theresa May initially went out of her way to extend a hand of friendship to the new Trump administration. She offered the president a full state visit just a week after his inauguration, prompting speculation that she was hoping to secure a good trade deal post-Brexit. But things have since grown strained.
Robin Niblett, the director of Chatham House, a London think tank, said that U.S.-British relations are "buffeted" by Trump's moods. He noted that on some matters, such as the day-to-day business of security cooperation between the two countries, the relationship is good but that on big foreign policy issues — such as the Paris climate agreement or the Iran nuclear deal — it is tense.
"A personal relationship between Trump and May should be there to cover some of those differences in strategic approach, but it just can't," he said, adding that Trump is "constantly looking for new excuses not to come."
Some foreign policy analysts in Washington suggested Trump and May could meet this year on the sidelines of summits in other countries, and one suggested Trump could visit a smaller city in Britain, perhaps one that included one of his golf resorts.
"It is extraordinary that the president of the United States cannot visit Britain over the fear of mass protests," said Thomas Wright, director of the Center on the United States and Europe at the Brookings Institution in Washington. "That's unprecedented."
Julie Smith, a senior fellow at the Center for a New American Security who served as deputy national security adviser for Vice President Joe Biden, called it "a sorry state of play."
"It says a lot about where our relationship is with the U.K. and how thin-skinned our president is," she said.
Smith scoffed at the idea that Trump was worried about the cost and location of the embassy, noting that the move has been in the works for years.
The old embassy is in elegant Mayfair, an area dotted with foreign embassies and close to West End department stores. The area is full of residential buildings, and neighbors were apt to complain about the threat to their homes.
Robert H. Tuttle, who served as U.S. ambassador to Britain from 2005 to 2009, said he knew early on that the mission would need to move.
"There were two narrow side streets by the embassy," he said in an interview. "They are very slim, and if someone came down there with a truck, a la the Oklahoma City bombing, it would not only blow up half the embassy and kill half the people in it, but it would also kill half the people in nearby residences."
Johnson, the current ambassador, agreed that security concerns after Sept. 11, 2001, necessitated the move. The new, bigger embassy is in Nine Elms, a former industrial area in Battersea, south of the River Thames. It's as close to Westminster as the old embassy.
In a piece for the Evening Standard newspaper, Johnson wrote that the new billion-dollar facility "did not cost the US taxpayer a cent" — it was financed by selling off other London properties — and is "the most secure, hi-tech and environmentally friendly embassy that the United States has ever built. "
In his tweet, which landed at 5 a.m. London time, Trump wrote: "Reason I canceled my trip to London is that I am not a big fan of the Obama Administration having sold perhaps the best located and finest embassy in London for 'peanuts,' only to build a new one in an off location for 1.2 billion dollars. Bad deal. Wanted me to cut ribbon — NO."
In fact, it was the George W. Bush administration that decided more than a decade ago to relocate the embassy during a worldwide push to improve security at U.S. diplomatic sites.
Trump is a highly controversial figure in Britain, where he recently succeeded in uniting politicians across the political aisle when he retweeted a far-right group's anti-Muslim videos. There is reason to believe that a visit by the president also would be met by loud opposition in the streets.
Shortly after Trump's inauguration, tens of thousands of demonstrators turned out in London for a women's march in solidarity with anti-Trump rallies worldwide.
A group called "Stop Trump" vowed the "biggest demonstration in British history," should Trump visit. On a Facebook event page, more than 8,000 registered to attend a rally for a protest event that isn't even scheduled.
A wax figure of the U.S. president did not get the memo about the canceled visit and on Friday made a brief appearance outside the new U.S. embassy.
Trump's visit there was expected to be a scaled-down working trip that would include a ribbon-cutting ceremony. British media outlets reported that Secretary of State Rex Tillerson will now do the honors.
Two White House officials did not respond to requests for comment Friday.
Asked about Trump calling off his embassy visit, a Downing Street spokesman reiterated that a full state visit, where the queen acts as official host, "has been accepted and stands."
Despite being offered nearly a year ago, that visit has yet to be scheduled.
Meanwhile, Twitter users seized the moment. The site was abuzz with people sharing fanciful reasons for canceling a trip to London using the hashtag #ICancelledMyTripToLondon.
Jennifer Hassan and Rick Noack in London and Adam Taylor and David Nakamura in Washington contributed to this report.