Donald Trump and Theresa May pictured in Brussels ahead of a Nato summit meeting in May last year.
Photograph: Dan Kitwood/Getty Images

Donald Trump has cancelled a visit to Britain next month to open the new US embassy in London, amid fears of mass protests.

The president claimed on Twitter that the reason for calling off the trip was his displeasure at Barack Obama having sold the current embassy for “peanuts” and built a replacement for $1bn (£750m). “Bad deal,” he wrote.

The London mayor, Sadiq Khan, said Trump had “got the message” that many Londoners staunchly opposed his policies and actions.

The fabulous new US embassy is best not tainted by a Trump visit | Oliver Wainwright

Read more

“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,” Khan said on Friday.

“His visit next month would without doubt have been met by mass peaceful protests. This just reinforces what a mistake it was for Theresa May to rush and extend an invitation of a state visit in the first place.”

The prime minister invited Trump for a state visit when she became the first world leader to visit the president in the White House a year ago. Activists immediately pledged to stage protests and MPs have said they would not give the president the opportunity to address parliament.

Asked about Trump’s cancellation, a Downing Street spokesman repeated the government’s longstanding position that “an invitation has been extended and accepted, but no date has been set”.

The White House press secretary Sarah Sanders said: “The invitation was made and has been accepted we are still working to finalise a date.”

Instead of a state visit, it had been expected that Trump would make a brief, less formal “working visit” in February to cut the ribbon on the embassy in south-west London, and hold meetings with May. Officials had also been examining plans for the president to meet the Queen without the pomp of a full-blown state banquet.

Government sources suggested Washington had signalled that the secretary of state, Rex Tillerson, would instead open the embassy.

Trump confirmed on Twitter late on Thursday night that the trip was off. “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,” he wrote just before midnight local time. “Bad deal. Wanted me to cut ribbon-NO!”

British relations with the president hit a low late last year when May criticised his decision to retweet videos posted by the far-right extremist group Britain First.

Trump responded by tweeting directly to the prime minister that she should focus on tackling domestic terrorism.

The government was so concerned about his decision to share the videos that Britain’s ambassador to Washington, Sir Kim Darroch, took the rare step of raising the issue directly with the White House.

London’s new US embassy: a very diplomatic America on Thames

Read more

Trump’s ambassador to London, Woody Johnson, subsequently insisted: “The president and the prime minister have a very, very good relationship. I know the president admires and respects the prime minister greatly.”

May’s government has been keen to strike up a close relationship with the Trump administration despite his erratic behaviour, because of Britain’s desire to strike a swift trade deal with the world’s largest economy when it leaves the European Union.

Trump has sparked alarm among diplomats by repeatedly entering into Twitter spats with key public figures, including the North Korean leader, Kim Jong-un, to whom he recently boasted about the size of the US nuclear arsenal.

The White House has been rocked in recent days by the revelations in an explosive book, Fire and Fury, by the US journalist Michael Wolff, who suggested senior figures in the administration questioned the president’s fitness for office.

Asked about the revelations last weekend, May said she believed they were not serious, and Trump was a man making decisions “in the interests of the United States”.