Also in attendance were the queen’s youngest son, Prince Edward, with his wife Sophie and their children, and Princess Eugenie, the daughter of Prince Andrew.
The queen, who turns 96 on Thursday, is celebrating her Platinum Jubilee this year, marking 70 years on the throne.
She cut back on public duties on her doctors’ orders since spending a night in hospital in October, and also had a bout of COVID-19 in February.
Harry and Meghan visited the queen at Windsor on their way to the Netherlands for the Invictus Games. Harry is founder and patron of the international sports competition for wounded or ill military personnel and veterans.