The brothers, the sons of King Charles III, were joined by their cousins, Peter Phillips, Zara Phillips Tindall, Princess Beatrice of York, Princess Eugenie of York, Lady Louise Mountbatten-Windsor and James, Viscount Severn.
Both William and Harry wore military uniform at the vigil at Charles's request, while their cousins wore "morning coat and dark formal dress with decorations," according to Buckingham Palace.
It was the first time since the queen's death that Harry has been seen in uniform. He had a decade-long military career that included two tours of duty in Afghanistan, but is no longer a working royal.
Harry -- who, along with his wife Meghan, the Duchess of Sussex, stepped down from their senior royal roles in 2020 -- will not wear military uniform at the queen's funeral on Monday at Westminster Abbey.
The grandchildren's vigil on Saturday marked a rare public reunion of all eight of the queen's grandchildren, who lovingly knew the queen as "Granny."
The last time the family is known to have gathered prior to the queen's death was in June, when they celebrated the queen's Platinum Jubilee, but the public never saw all of the grandchildren together.
All eight grandchildren are expected to be together again Monday at the queen's state funeral at Westminster Abbey.
The grandchildren, who spent summers with the queen at Balmoral Castle and Christmases with her at Sandringham, are now nearly all adults with 12 children between them.
The Queen and The Duke of Edinburgh surrounded by seven of their great-grandchildren at Balmoral Castle in 2018.— The Royal Family (@RoyalFamily) April 14, 2021
©️ The Duchess of Cambridge pic.twitter.com/xMmbzfDHwL
In a statement following her death, William said that while the world lost a leader, he had "lost a grandmother."
"And while I will grieve her loss, I also feel incredibly grateful. I have had the benefit of The Queen's wisdom and reassurance into my fifth decade," he said. "My wife has had twenty years of her guidance and support. My three children have got to spend holidays with her and create memories that will last their whole lives."
Here is a look at the queen's eight grandchildren who gathered to hold vigil at her coffin.
William, the Prince of Wales
George, Louis and Charlotte are second, third and fourth in line to the throne, respectively.
Harry, the Duke of Sussex
Harry, 37, fifth in line to the throne, is the youngest child of Charles and Diana.
Archie and Lili are sixth and seventh in line to the throne, respectively.
Princess Beatrice of York
Beatrice, ninth in line to the throne, is the eldest daughter of Andrew and his former wife, Sarah Ferguson.
Beatrice, 34, is married to Edoardo Mapelli Mozzi, with whom she shares a 1-year-old daughter, Sienna Elizabeth, who is 10th in line to the throne.
Princess Eugenie of York
Eugenie, 11th in line to the throne, is the youngest daughter of Andrew and Ferguson.
The 32-year-old is married to Jack Brooksbank, with whom she shares a 1-year-old son, August Philip Hawke Brooksbank, who is 12th in line to the throne.
James, Viscount Severn
James is the son of Prince Edward and Sophie, the Countess of Wessex.
The 14-year-old is 14th in line to the British throne.
The Lady Louise Mountbatten-Windsor
Louise is the daughter of Edward and Sophie.
The 18-year-old is 15th in line to the British throne.
Louise falls behind her brother in the line of succession despite being older because she was born after 2011. A 2013 law called the Succession to the Crown Act ended the centuries-old practice of a younger son superseding an elder daughter in the line of succession, but the law only applies to royals born after Oct. 28, 2011.
Peter Phillips, 17th in line to the throne, is the queen's oldest grandchild at 44 years old. He is the eldest child of Anne, the Princess Royal, and her former husband, Peter Phillips.
Phillips is the father of Savannah Phillips, 11, and Isla Phillips, 10, who are 18th and 19th in line to the throne, respectively.
Zara Phillips Tindall
Zara Phillips Tindall, 20th in line to the throne, is the youngest child of Anne and Phillips.
The 41-year-old is married to Michael Tindall, with whom she shares three children: Mia, 8, Lena, 4, and Lucas, 1, who are 21st, 22nd and 23rd in line to the throne, respectively.