LONDON — Queen Elizabeth II has sprained her back and will miss a Remembrance Sunday service to commemorate those who died in Britain’s wars, Buckingham Palace said in a statement, just hours before the monarch was due to make her first public appearance since spending the night in hospital last month.

The palace said the queen, who is 95, was “disappointed” to miss the ceremony, where she was expected to lead the nation in paying tribute. The queen is the head of the country’s military, and the annual event is one of the most significant in the royal calendar.

Prince Charles, heir to the throne, will lay a wreath of poppies on Her Majesty’s behalf, as he has done in previous years. Prince William and Kate, the Duke and Duchess of Cambridge, will attend along with other members of the royal family.