The US president and the monarch posed for a group photo and shook hands warmly before Donald Trump left for Chequers.
US president Donald Trump hailed the King as a “great gentleman and a great King” as he bid a formal farewell and thanked the monarch for hosting his historic second state visit.
The US leader and First Lady Melania Trump spent the night in the 1,000-year-old royal residence after being feted with a lavish state banquet and an array of military celebrations.
At the Sovereign’s Entrance to the castle, the King and Mr Trump shook hands warmly at the top of the steps, with Mr Trump pulling the King’s hand towards him and placing his other hand on top of Charles’s.

There was also a gentle pat on the arm for the King from the American leader as they chatted together with ease, nodding their heads.
Looking out towards the gathered media, the president declared, pointing at Charles: “Thank you very much, everybody. He’s a great gentleman – a great gentleman and a great King.”
There was a further light pat on the monarch’s left arm and another briefer handshake before Mr Trump made his way down the steps to be driven away in his Beast Cadillac.

Shortly beforehand, Mr Trump and the first lady had posed for a group photograph with the King and the Queen to say their goodbyes inside the castle in the grand Green Corridor before the president headed solo to the Prime Minister’s country residence Chequers, ready to turn his attention to politics.
Mr Trump adjusted his jacket before standing stock-still with his arms by his side and giving his trademark grin, as he stood next to the King, with the first lady on the president’s other side, and the Queen next to Charles.
The president quipped, prompting a large chuckle from the King: “I looked at the picture we took last night… But you were more serious than me… She (Melania) said ‘You’re smiling’ and I said ‘Yeah, I like it when I smile’.”

Mr Trump is believed to have been referring to the group photograph taken ahead of the lavish banquet on Wednesday evening, which appeared on the front of a number of national newspapers on Thursday.
Earlier, as the King and Queen greeted Mr Trump and his entourage further down the corridor out of sight, laughter could be heard between the two groups, with the president loudly entertaining his hosts.
In keeping with protocol, Mr and Mrs Trump did not have breakfast with the King and Queen on Thursday morning. The suite the president stayed in overnight at the castle was not disclosed for security reasons.

Meanwhile, a royal source hailed Mr Trump’s second state visit as a success, saying the president and first lady showed how much they appreciated the “awesome spectacle”.
The president and his wife had been “very easy to deal with” throughout their stay at Windsor, the source added.
“It was very pleasing to see the way the state visit has been warmly received both by the guests and the media on both sides of the Atlantic,” the source said.
“It’s a clear sign of soft power and diplomacy.
“The visiting party was very easy to deal with and very appreciative of the hospitality.

“All elements of the pomp and pageantry created an awesome spectacle.
“You can tell from the expression of the principals how much they appreciated it.”
The Windsor Castle detachment of The King’s Guard turned out in the Quadrangle outside to mark Mr Trump’s departure.
Although Mrs Trump attended the official parting of ways, she stayed behind to carry out joint engagements, first with Camilla, and then with the Princess of Wales.
She joined the Queen for a tour of Queen Mary’s Dolls’ House and the Royal Library in Windsor Castle.

Looking at the treasures inside the 1:12 scale replica of an Edwardian residence which was given to Queen Mary, the King’s great-grandmother, as a gift from the nation following the First World War, the first lady said: “It’s so cute.”
Camilla showed her the dolls’ house’s garden, saying: “I love the garden. Look at the table. It’s so beautiful.”
Mrs Trump echoed: “It’s so beautiful.”
The dolls’ house is the largest and most famous dolls’ house in the world and the 100th anniversary of its creation was celebrated last year.
It features electricity, working lifts, running water, luxurious royal suites and functional below-stairs servants’ quarters, and a library of more than 170 works by authors such as Sir Arthur Conan Doyle, Vita Sackville-West, AA Milne, Thomas Hardy and Aldous Huxley who all penned miniature books.