The offer, passed on by Theresa May during her Washington visit, was considered a masterstroke in Whitehall, playing to the new US president’s love of royalty inherited from his Scottish mother Mary, born on the Isle of Lewis.
But as months turned to years without taking place the trip had morphed from the crowning glory of the renewed special relationship to an albatross around its necks.
The prospect of a hostile British public, inevitable protests and the possibility of Mr Trump reacting to both had, White House sources believed, resulted in the UK dragging its heels.
Now though, in the summer of 2019 - some two and a half years after the invitation was made - the state visit was on. There was, however, a snag.
Buckingham Palace demands
As planning for the trip intensified, the White House aides repeatedly pressed upon their Downing Street colleagues that one element was apparently critically important - a stay in Buckingham Palace.
Mr Trump, an instinctive royalist, had met the Queen for tea at Windsor Castle during his first trip to Britain as president the year before, something he would recount often and with joy to advisers once back home.
This time though Mr Trump was bringing the whole family - not just wife Melania but his four adult children Ivanka, Donald Jr, Eric and Tiffany, a law student at the time. Only Barron, still a teenager, remained.
When Barack Obama, Mr Trump’s predecessor and a constant target of his hostility, took up his state visit with wife Michelle in 2003 they got a bed in Buckingham Palace. The current president expected the same, according to well-placed sources.
The problem was the Palace was under renovation. Whole areas had been closed off for the makeover. Even some Royal household members had been temporarily moved out.
But when that was communicated to Washington, the same message came back. Mr Trump wanted Buckingham Palace.
Number 10 aides, fearing the headlines that would follow if they failed, redoubled their efforts, requesting a room-by-room breakdown of refurbishment plans.
“It was very, very clear Trump loved the Queen. He wanted to spend as much time as possible with the Queen and to stay at Buckingham Palace,” said one UK official at the centre of the state visit planning.
“We went to the point of saying to the Palace ‘can you tell us which rooms are undergoing refurbishment’. It was properly looked into. The last thing we wanted was a snub story coming out. But it couldn’t work.”
Instead Mr Trump and his security detail were put in Winfield House, the sprawling US ambassador’s residence in Regent’s Park. But even that posed difficulties.
“We wondered whether Regent’s Park Mosque would wake him up in the morning”, one White House adviser working on the visit said. They decided to take the risk.
The Palace stay request, while ultimately failing, was seen as a reflection of the high esteem with which the US president held Her Majesty - something UK officials believed would help foster closer ties between both countries.
“I think she is the only person he truly respects,” the same ex-White House adviser said. “I don't think he was as enamoured with the Pope as the Queen. There was a hierarchy of celebrity and she was top. It was his mother's influence."
Fears of 'hissy fit'
Some 3,000 miles away on the other side of the Atlantic, however, other concerns were brewing. Ever present in state visit planning were fears that Mr Trump would come to believe he was getting less than predecessors.
To prepare themselves, White House advisers drew up a spreadsheet. The document listed the names of modern US presidents who had been offered UK state visits - Mr Trump, Mr Obama, George W Bush and so on.
It then had all the specifics of each trip. The details were exhaustive - not just the duration of the visits and whether there was a parade but also what dinner was served and the exact format for gatherings with the Queen.
I will rise tomorrow. Parliament Square Gardens. 10am. pic.twitter.com/KDbZ0kvVQD— Trump Baby (@TrumpBabyUK) June 3, 2019
The spreadsheet allowed advisers at a glance to compare trips should Mr Trump ask. One ex-White House source involved said the document was requested by the offices of the First Lady and the president's chief of staff. Another headache was protests.
The balance of reasons for why Mr Trump was kept away from crowds is disputed - some sources said security concerns were paramount - but clearly some political advisers pushed to avoid demonstrations.
“We discussed how he would react,” said the same White House source, outlining the concerns. “He would blame the UK government. He'd engage in a really nasty way, in a way that would end up blowing the entire relationship. You've seen him have a hissy fit with Justin Trudeau [the Canadian prime minister] and other leaders.”
Some on the British side feared the same. “The President literally has the thinnest skin of anyone who's ever been elected to that office,” said a former UK official who worked on the trip. "It was just accepted wisdom to try to avoid crowds.”
In the end, the visit went off without a hitch. The Trumps seem enthused by their Royal encounters, with footage of a tour of Her Majesty’s art collection showing the Queen and the president smiling and chatting while Prince Harry and Ivanka followed together behind.
Trump's Churchill love
The state visit’s ultimately smooth delivery was thanks in part to the trial run - Mr Trump’s first official trip in July 2018, the previous summer.
The president had thrown that visit into chaos after openly disparaging Mrs May’s Brexit deal in an interview with The Sun published just as he flew in, something over which he offered a rare personal apology.
But all the elements for winning him over were there - “the grandeur, the gold, the history”, as one UK source who worked closely on both trips put it. “We were always trying to do everything that was biggest and best.”
One success was Mr Trump’s trip to Sandhurst, where British Army officers are trained. A staged hostage rescue from UK and US special forces was put on, with soldiers descending from helicopters by rope and deploying flash bangs and fake gunfire.
Mr Trump, clearly riveted, could see footage taken from live body cams of those involved. It was textbook diplomacy, spectacle with a serious point - the importance of UK-US military partnership. John Bolton, then the White House national security adviser who was there, recalls in his book scolding himself for not thinking of it sooner.
Another triumph was the Churchill factor. UK officials played to the president’s love of Sir Winston Churchill by hosting him in Blenheim Palace, the former prime minister’s grand ancestral home in Oxfordshire.
James Spencer-Churchill, the 12th Duke of Marlborough and distant relative of the war time prime minister, gave Mr Trump a bust of Churchill, which went back with him to Washington, and delivered a glowing toast at the dinner.
Scottish golf course
The US president gave his own toast which, some there recalled, drifted off-script. “Half way through the speech he starts talking about Sean Connery”, one Number 10 aide in the room recalled.
"He said ‘I couldn't get a permit for this golf course and I called my buddy Sean Connery, 007. And two days later it was fixed!'”
Another former Downing Street insider said during the same riff about Scottish golf courses and the difficulty in securing planning permission the president called out Theresa May’s husband, who had a career in finance.
“He looked at Phillip May and said ‘do you know any good zoning lawyers”, the source said. The president was greeted with a bemused smile. “Philip May didn’t say anything.”
Mr Trump, who owns two golf courses in Scotland, was a fierce opponent of Scottish independence. At other moments separate from the visit advisers recall the president voicing his opposition to a split, including raising an unusual concern.
“He was shocked by the idea that Scotland might break out of the UK. At one point he said ‘but then it wouldn’t be the British Open’”, a former senior White House adviser recalled, referring to the prestigious golf tournament held throughout the UK.
To wow the president during that first UK visit, Number 10 also had a gift. After much deliberation it was agreed that a genealogist should trace Mr Trump’s entire Scottish ancestry, working back from his mother.
The full Scottish family tree was presented to the president with a flourish along with a sample of what they dubbed “Trump tartan”, supposedly the family’s traditional colours, according to one person involved. It was well received.
Not every bid to woo Mr Trump went without a hitch though. While in Chequers the president was shown Sir Winston’s favourite chair. Mr Trump sat and appeared to pose like the former prime minister for a photograph.
The image was tweeted out by Sarah Sanders, then Mr Trump’s press secretary, and jumped on by the British tabloids who rejected the implicit comparison between leaders.
The Mirror wiped out their whole front page for the photo. The headline read: “HOW DARE YOU”.
When Mr Trump won his shock election in 2016 the big advantage touted by Brexiteers was that there would now be an out-and-out supporter for their cause in the White House.
It was a hope shared by Mrs May and her entourage as they developed a strategy to both secure a weighty UK-US trade deal and use that prospect as leverage in talks with Brussels.
Yet over the two-year period between Mrs May’s great gamble, the June 2017 election which lost her the Tories’ Commons majority, and her departure in July 2019 the dynamics flipped.
Far from having a supportive president cheering her on, Mrs May instead faced a critical counterpart who openly disparaged the withdrawal agreement on which her entire premiership depended.
The real reasons for Mr Trump’s antipathy towards the deal are difficult to ascertain, but the thoughts of figures in the two leaders’ inner circles at the time offer some light.
Mr Trump had a deep suspicion of the EU, bemoaning how they “ripped off” America on trade. Figures at the top levels of Downing Street believed it spun out from anti-German sentiment. Mr Trump’s grandfather was German.
It is also clear from numerous well-placed sources that Mr Trump considered Mrs May weak in Brexit talks. His advice to Mrs May that she quit Brexit talks and sue the EU, something she has confirmed in public, became a repeated talking point.
‘You’re not getting enough leverage, you need to get a better deal”, he would tell Mrs May again and again, according to one ex-White House official who sat in on Trump-May meetings. Her failure to follow the advice left him frustrated.
The coterie of hard Brexiteers around Mr Trump also shaped his thinking. Mr Bolton, who was in the Leave campaign headquarters the night of the referendum and knew many Tory MPs, ideologically backed a clean Brexit.
Woody Johnson, the US ambassador in the UK, was another believer in a clean Brexit and often would meet Eurosceptic MPs, according to numerous US officials. And then there was Nigel Farage, the Brexit Party leader who was close to Mr Trump.
The White House had a full inter-agency review running into how Brexit would impact every aspect of the US-UK relationship, with issues such as sharing data on criminal cases being raised as complications.
Career US officials working on Brexit preparation would sometimes write internal papers and urge a more nuanced stance but they had little impact at the top circles of the White House.
Were Mr Trump’s public swipes at Mrs May’s deal, usually prompted by a reporter question and a reflection of his no-filter responding style, part of a grand strategy to bounce Britain into a hard Brexit? Multiple US former officials suspect not.
Instead they see it as a mix of instinct, the influence of advisers and Mrs May not following his advice. “I never saw it as a concerted effort to achieve a hard Brexit, it was more ‘why are you bending back with the EU”, said an ex-White House adviser.
Those working with Mrs May could be frustrated. Sir Mark Sedwill, Britain's top civil servant, would sometimes talk Mick Mulvaney, then Mr Trump’s chief of staff, through the politics of why the president’s disparagement of Mrs May’s deal was so damaging.
But for Downing Street Mr Trump’s blasts were largely a distracting side issue, away from the core work of convincing sceptical MPs to vote through the deal in Parliament. Some, however, were left with a sense of ‘what if’.
“Washington wasn't there as a counsellor for the UK or EU sides,” one former May adviser who worked on Brexit said. “A different American president and a different US administration could have made a material difference in how things played out.”
Trump's 'offensive' tweet
One endless challenge for UK officials attempting to navigate the choppy waters of the Trump presidency were, of course, the tweets.
Throughout the last three-and-a-half years Mr Trump has, via Twitter, bashed London’s Brexit deal, mocked London’s mayor, promoted far-Right UK politicians and suggested British spies snooped on his campaign.
Just out report: "United Kingdom crime rises 13% annually amid spread of Radical Islamic terror." Not good, we must keep America safe!— Donald J. Trump (@realDonaldTrump) October 20, 2017
The tension it caused the relationship was self-evident from the outside, with Number 10 spinners put on the spot about whether the UK government condoned this message or was willing to publicly rebut that one.
Less clear at the time was quite how hard Downing Street pushed back behind the scenes. One tweet, one the morning of October 20 2017, was a case in point.
“Just out report: ‘United Kingdom crime rises 13% annually amid spread of Radical Islamic terror.’ Not good, we must keep America safe!”, the president wrote.
The message had all the hallmarks of a classic Trump tweet - quotation marks appearing to reference an unspecified media story, a message that fit his theme of the West under attack and little disregard for openly swiping an ally.
Sir Mark Sedwill, who was both Cabinet Secretary and UK national security adviser, was seething. “HR” read the first line of an email he fired off to HR McMaster, the White House national security adviser, which has been seen by The Telegraph.
“I realise you don’t control this but the POTUS tweet on our crime stats is inaccurate, meddlesome and offensive. We will try not to say that publicly….,” Sir Mark continued. He signed off with no pleasantries, just his first name.
Hours later a sympathetic response dropped: “Dear Mark, Message received my friend. Thank you. All the best, HR.”
The exchange was on one level remarkable - Mrs May’s top security adviser was calling out the US president in writing and accusing him of being “meddlesome and offensive”. But on another, it was par for the course.
Mr McMaster’s response captured the reality - a linguistic shrug of the shoulders. UK and US officials, like everyone else, had come to accept that Mr Trump could not, or would not, be stopped from tweeting his thoughts.
Some of the White House’s most senior figures had attempted to set up a committee to pre-screen and approve the president’s tweets early in his administration, it has been reported. If that failed, what hope would British officials have?
A line crossed
There were, however, moments when Downing Street felt obliged to push back publicly. This was especially true with Mrs May, who her former advisers say felt an obligation to speak out when the president crossed the line.
"What she found most difficult was when President Trump said things deeply against her values, perhaps about race or gender, things that she thought were unhelpful to the world,” one former May adviser explained.
Just that happened in November 2017 when Mr Trump shared a series of tweets containing anti-Islamic videos with titles like "Muslim migrants beating up a Dutch boy on crutches" and “Muslim destroys statue of Virgin Mary".
The person who Mr Trump had retweeted was Jayda Fransen, the deputy leader of Britain First, an extremist political group found on the outer edges of the far-right in the UK. It triggered an immediate media storm.
The tweets dropped on a day Mrs May was flying between three countries during a packed tour of the Middle East, according to one former aide who was with her and detailed what happened next.
Crouched over an adviser’s smartphone in a British military base, the prime minister was shown the videos. “It cost about 80 quid in data roaming to watch,” the aide later complained. But by the end Mrs May was decided.
“The fact that we work together does not mean that we're afraid to say when we think the United States has got it wrong, and be very clear with them. And I'm very clear that retweeting from Britain First was the wrong thing to do,” Mr May said when asked by reporters.
Her spokesman, with her sign-off, called Britain First “the antithesis of the values this country represents, decency, tolerance and respect.”
Mrs May had reprimanded the president. In return, she got a swipe back.
“Theresa May, don't focus on me, focus on the destructive radical Islamic terrorism that is taking place within the United Kingdom,” Mr Trump tweeted in response. “We are doing just fine!"
It was a reminder that no slight went unpunished in Trumpworld.