Omarosa Manigault, reality TV star turned political aide, snapped photos of the buffet and greeted staff serving eggnog. Sean Hannity, talkshow host, held court with multiple colleagues from conservative Fox News. John Kelly, chief of staff, chatted to journalists and military veterans in the East Room. A 200lb gingerbread White House, with 20lb of icing, stood beneath a portrait of Abraham Lincoln. A copy of Charles Dickens’s A Christmas Carol, read by President Franklin Roosevelt to his family, was displayed in the library.

At first glance, Friday’s White House Christmas reception was not so different from years past. But something was missing: the host. Instead of greeting guests and posing for souvenir photos like his predecessors, Donald Trump was upstairs in the White House residence – tweeting. “The media has been speculating that I fired Rex Tillerson or that he would be leaving soon,” he posted at 3.12pm, referring to reports that his secretary of state would soon be axed. “FAKE NEWS!”

Eight minutes later, Trump and first lady Melania descended the red carpeted staircase – passing Franklin Roosevelt’s portrait along the way – to the grand foyer of the White House, where a marine band played amid snowy trees adorned with miniature crystal nutcrackers. The president made brief remarks to “my friends in the media” and shook a few hands, but left after five minutes.

It was a sure way to avoid some awkward questions after another day, and week, that implied the opulent splendour of the occasion was less winter wonderland than Titanic. That morning, Trump’s former national security adviser Michael Flynn had pleaded guilty to lying to the FBI about his contacts with Russian officials. The previous day, there had been the reports about Tillerson’s expected demise. And before that, Trump had delivered one of his wackiest speeches yet – “I will tell you this in a non-braggadocious way. There has never been a 10-month president that has accomplished what we have accomplished” – while pushing a major tax overhaul and used a ceremony honouring Native American war heroes to mock a senator he has nicknamed “Pocahontas”.

“Something is unleashed with him lately,” Maggie Haberman, White House correspondent of the New York Times, told CNN. “I don’t know what is causing it. I don’t know how to describe it. I think the last couple of day’s tweets have been markedly accelerated in terms of seeming a little unmoored.”

Haberman, who has known Trump for years, added: “People are constantly saying, ‘Don’t do things.’ He’s also a grown man. He’s the president. They can’t handcuff him. They can’t break his fingers to keep him from tweeting. They do tell him: ‘Please don’t do this.’ He does these things anyways.”

The tweetstorms – that unrivalled glimpse into Trump’s id – raged with particular violence this week, triggering one of the worst diplomatic ruptures with the UK since British troops torched the White House in 1814. It started when Trump shared three anti-Muslim videos posted by Jayda Fransen, deputy leader of the far-right hate group Britain First. Theresa May’s office said he was wrong to do so. Then Trump fired back: “Theresa @theresamay, don’t focus on me, focus on the destructive Radical Islamic Terrorism that is taking place within the United Kingdom. We are doing just fine!”

In fact @theresamay belonged to a different woman; Trump quickly realised his mistake and corrected it to @Theresa_May. The prime minister stuck to her guns and reiterated that Trump had been “wrong” to retweet the incendiary and unverified videos. She was joined by Labour leader Jeremy Corbyn, the Archbishop of Canterbury, the (Muslim) mayor of London and even longtime Trump cheerleaders Piers Morgan and Nigel Farage. Yet the White House defended Trump and the press secretary, Sarah Sanders, saying she had come down with strep throat, ignored shouted questions from British reporters as she wound up a briefing.

US president Donald Trump’s Twitter account in which he tried to tweet the British prime minister, Theresa May. Photograph: Twitter

Just as Prince Harry and actor Meghan Markle were planning an Anglo-American union, it seemed the special relationship was heading for the divorce court. There were demands for May to withdraw the offer of a state visit she had rashly made to Trump when, hastening to Washington in January, she became the first foreign leader to meet the new president. A source close to the president said he still intended to visit but his next overseas trip would be to Latin America in April, and it will certainly not be before then. The source said Trump has spoken with May after recent terrorist attacks and described their relationship as positive.

The extraordinary spat refocused attention on Trump’s Twitter habit and its potential to wreak diplomatic havoc. It is true that, long after the fact, letters and telegrams revealed tensions in the relationship between wartime leaders Winston Churchill and Franklin Roosevelt, and recordings demonstrated how Ronald Reagan apologised to Margaret Thatcher for invading the former British colony of Grenada without her approval. But Trump’s Twitter barbs take place in real time and on full public display. It forced May to respond with sharp words and, some fear, could one day goad North Korea’s Kim Jong-un to respond with a nuclear missile.

Sir Christopher Meyer, the former British ambassador to the US, said: “In all the time I’ve dealt with the United States, I’ve never heard a British prime minister have to publicly rebuke an American president. John Major was furious when Bill Clinton granted [Sinn Fein leader] Gerry Adams a visa but he did not go public with it. I find that striking.”

There have been disagreements between America and Britain before, Meyer noted, including over the Suez Crisis and prime minister Harold Wilson’s refusal to send troops to Vietnam. “We’ve had passages of disagreement but most of it has been beneath the surface and private. This is all in public and that’s unprecedented.”

Thomas Countryman, a US foreign service officer for 35 years, said: “The UK and the US have had sharp disputes in the past, but I am not sure I have ever seen such a sharp dispute over such a non-substantive issue and it cannot possibly help the special relationship.”

He added: “This president has made a speciality of putting both American and allies’ diplomats in a difficult situation.”

‘Olympian lightning bolts’

Trump joined Twitter in March 2009, when the social media site was three years old. He has since posted 36,500 tweets (not all written by him personally) and has 43.8 million followers (Katy Perry has 107 million; Barack Obama has 97.4 million). He is following 45 accounts comprising mainly his family, White House staff, his golf clubs, Fox News journalists – and Morgan. He weaponised tweeting during the bitter election campaign and has carried on using it divisively as president.

In January the New York Times observed: “While that habit generated conversation and consternation when Mr Trump was a candidate, he now serves as commander in chief and his 140-character pronouncements carry the power of an Olympian lightning bolt.”

Trump’s very first tweet, in May 2009, promoted an appearance on a late-night TV show. It was the work of Peter Costanzo, who worked in marketing for the publisher of Trump’s book Think Like a Champion and was thinking of new ways to promote it.

“Facebook was already popular for publishers but Twitter was new,” Costanzo recalled. “People didn’t really understand what it was or its potential.”

He spotted that there was an impostor already using Trump’s name on Facebook and Twitter. He contacted Facebook and got the 200,000 followers transferred to a new, authentic Facebook account. “But Twitter had no verification process and the book was coming out in three weeks.”

Costanzo went to Trump Tower in New York to propose a new Twitter identity for the billionaire businessman and Apprentice host. “I said, let’s call it ‘@realDonaldTrump’. He really seemed to like the idea. He liked the sound of it. I set up the account and uploaded the photo you still see today. I started tweeting benignly. It got followers very quickly.”

Costanzo ran the account for about eight months until he left the publishing company. He has since watched @realDonaldTrump “take on a life of its own”. He continued: “The proof is in the result: he used Twitter as a way to really get people to feel he was talking to them and they elected him, they put him in office. There’s no arguing that for him it’s proved very effective in a positive way.”

Asked if he had inadvertently created a monster, Costanzo replied: “Whatever way Donald Trump has chosen to use Twitter is obviously his responsibility. It’s proven to be his number one choice for communicating the topics on his mind.

“I definitely recognise that I started something but one can’t make predictions what way it’s going to go. It’s been a wild ride. Twitter has been a topic of conversation every week during his campaign and now during his presidency.”

On his wild Wednesday, Trump began tweeting at 6.32am with a familiar plug for the Fox News show Fox & Friends, which he watches in the residence. The first retweet of Britain First – “VIDEO: Muslim migrant beats up Dutch boy on crutches!” – followed minutes later, eventually earning a correction from the Dutch embassy, which noted the perpetrator was not Muslim. Idiosyncratic tweets followed throughout the day as Trump travelled to Missouri – he is known to tweet from cars and planes – then the swipe at May arrived at 8.02pm. He rounded off the day with another old trope, a dig at Barack Obama, at 9.23pm.

Costanzo, who now produces and markets books for the Associated Press, added: “This is the point of Twitter: the immediacy. You can get something out there whenever you want. It bypasses traditional media channels and allows people to share whatever they want to share.”

Donald Trump at his Mar-a-Lago estate in Palm Beach, Florida. Photograph: Alex Brandon/AP

But even some of Trump’s confidants believe he went too far with the Britain First tweets. Christopher Ruddy, chief executive of Newsmax Media, who spent part of Thanksgiving weekend with the president at his Mar-a-Lago club in Florida, said: “I think it was mistake to send out the anti-Muslim videos. I have personally and publicly encouraged him to do a review process. I think the tweets are hurting him in the polls.”

Ruddy’s pleas have fallen on deaf ears. “I think he feels cornered by the media and this is his outlet,” he said. “His attack on Theresa May was pretty gentle, pretty mild when compared to others.”

Not every tweet is Trump’s own work. Kelly takes little interest but the White House’s director of social media, Dan Scavino, has a hand in some. The men met when Scavino caddied for Trump at a golf club in Westchester, New York. The Politico website reported: “He has said that he often taps out tweets for the president’s account as Trump dictates them, and he has a knack for mimicking his boss on Twitter. ‘Scavino channels Trump, not the other way around,’ said a senior White House aide.’”

‘Twitter is perfect’

Trump’s unapologetic embrace of Twitter makes perfect sense to his biographer Gwenda Blair, author of The Trumps and Donald Trump: The Candidate.

“He’s a salesman and a salesman’s No1 technique is to keep the attention on him and frame what the conversation is and control what is being discussed,” she said. “Twitter is perfect: it allows him to get out ahead of the news agenda. Although Twitter wasn’t around in the 70s, that performance MO was already in place.”

The speed of Twitter enables Trump to outrun fact-checkers, Blair added. “There’s often speculation that various officials at the White House have tried to rein him in and calm him down, get his finger off the send button. Perhaps. I think that’s in part wishful thinking because it’s like his magic wand. Why would they want to take it away? He’s used it to undermine the media, detach facts from truth, makes himself the arbiter of what’s important and cement that politics-of-grievance bond.”

Under any other president, the clash with Britain would have dominated the entire week. In Trump’s world, it was quickly buried under an avalanche of fresh dramas. Joe Scarborough, a former Republican congressman turned TV host, suggested the president is now “completely detached from reality”. He said on the MSNBC channel: “You have somebody inside the White House that the New York Daily News says is mentally unfit. That people close to him say is mentally unfit, that people close to him during the campaign told me had early stages of dementia.”

But another explanation for the president’s boisterous behaviour, seemingly emboldened, carefree of consequences, may have been that he sensed a legislative victory finally in his grasp. In the early hours of Saturday, Senate Republicans passed a $1.5tn tax bill that would deliver massive gains to corporate America and the wealthy.

True to form, Trump responded on Twitter: “Look forward to signing a final bill before Christmas!” The message was posted at 2.49am.