Prince Harry and the Duke and Duchess of Cambridge became children's entertainers while hosting a party for the families of servicemen and women killed while serving their country.
Among those at Buckingham Palace were the widow and son of Fusilier Lee Rigby, killed outside Woolwich Barracks in south-east London in 2013.
Prince Harry told the crowd: "We're here to celebrate you".
The prince and duke have recently spoken of the loss of their mother.Image copyright PA Image caption
William and Kate joined children at face-painting and cupcake decorating stalls, while circus acts and magicians also entertained the guests.Image copyright PA Image caption Image copyright PA Image caption
Prince Harry told guests: "We as a family, we as a nation, and we up and down the country will never ever forget about the sacrifices that every single one of you have made."
He added: "For that, every single one of us here, all the organisers, the three of us the whole of our family and the whole of this nation, thank you so, so much for everything you guys have done.
"I can assure you that Buckingham Palace gardens have not seen this much fun, ever."Image copyright PA Image caption