The King spoke of his pride in his two sons as he attended his first passing out parade at Sandhurst since becoming monarch.
Both the Prince of Wales and Duke of Sussex graduated as officer cadets from the military academy before going on to careers in the Armed Forces.
On Friday, the King inspected the 200th Royal Military Academy Sandhurst’s Sovereign’s Parade and also spoke of his own experiences “surviving” military training.
His speech came after Buckingham Palace confirmed this week that Harry will attend the Coronation on May 6, but his wife will stay in California with the couple’s children.
The King said: “Speaking as a father of two alumni of this academy, I know they will be full of immense pride in witnessing you on parade.”
He joked: “Having attended — and survived — two of the other military academies 50 years ago, I think I have some idea of the challenges which are inherent in military training.
“I have experienced the nerves, the exhaustion — even the self-doubt. But despite such recollections, it is the lifelong friendships which are forged through shared hardship, and the humour you find in the darkest hours of the coldest, wettest nights, which remain with you.”
He added: “As we have now passed the first anniversary of the conflict in Ukraine, it is worth saying that I have been particularly impressed and proud of the role the British Army, alongside wider Defence, has played in supporting Ukraine.”
He said that after a recent visit to Salisbury Plain and through the discussions he had with Ukraine’s president Volodymyr Zelensky a few weeks ago, the King said he had learnt first-hand about the impact this support is having on the ground.
In April 2006, the late Queen reviewed Harry at Sandhurst when he was commissioned as an officer in the British Army.
After graduating from the University of St Andrews in 2005, William joined the Royal Military Academy Sandhurst and was commissioned as a British Army officer in December 2006.