Donald Trump will meet the Queen at Windsor and hold talks with the prime minister at Chequers on his two-day visit to the UK next week.
The itinerary for Thursday and Friday confirms the US president will stay at the US Ambassador's House in Regent's Park overnight.
But other formal events will be held outside London.
Thousands are expected to stage protests in the capital and in Scotland, where he will go on Friday.
President Trump will fly into the UK on Thursday afternoon with First Lady Melania Trump, following a Nato summit in Brussels.
The couple will attend a black-tie dinner on Thursday hosted by Theresa May at Blenheim Palace in Oxfordshire - the birthplace of Sir Winston Churchill.
Although classed as a working trip rather than a state visit, the president will be greeted with a military ceremony in the Great Court, with the bands of the Scots, Irish and Welsh Guards playing the Liberty Fanfare, Amazing Grace and the National Emblem.
Invited guests, including a number of business leaders, will eat dinner to the sounds of the Countess of Wessex's Orchestra, which will play a "series of classic British and American hits", according to Mrs May's deputy spokeswoman.
Mr Trump, whose mother was Scottish, will then be piped out at the end by the Royal Regiment of Scotland.
After spending the night at Winfield House in London, hosted by his ambassador Robert Johnson, the president will join the prime minister to watch a UK military exercise, before the pair travel to Chequers - the PM's country residence in Buckinghamshire - for bilateral talks.
The president and first lady will then travel to Windsor to meet the Queen on Friday afternoon.
On the final leg of the tour, the couple will fly to Scotland, where they plan to spend the weekend.
Thousands are expected to protest in London on Thursday and Friday against the president's visit.
London Mayor Sadiq Khan has granted permission for a giant inflatable figure depicting Mr Trump as a baby to fly over Westminster for two hours on the second day of the president's visit.
Others are holding marches through the city and in Scotland - where President Trump owns golf courses.