The service formed part of Royal Week in Scotland; the King also took part in a Ceremony of the Keys and the couple hosted a garden party. William has been active on homelessness initiatives, visiting Aberdeen as part of his Homewards project, work inspired by his late mother.
The sombre date recalled Princess Diana, who died in 1997 following a car crash in Paris. The day combined official ritual with personal memory and ongoing public debate.