The Queen has said it is “difficult to escape a very sombre national mood” following tragedies in London and Manchester.
The monarch said the UK had “witnessed a succession of terrible tragedies” in recent weeks.
Her official birthday message followed protests over the Grenfell Tower fire which killed at least 30 people.
The Queen’s message added: “Put to the test, the United Kingdom has been resolute in the face of adversity.”
It comes after Prime Minister Theresa May, who was jeered when she visited the Kensington site on Friday, pledged to “get to the bottom” of the west London tower block fire amid mounting criticism of her response to the disaster.
The Queen and Duke of Cambridge had earlier met volunteers, residents and community representatives during a visit to the Westway Sports Centre.
In her statement, described by the BBC’s royal correspondent Nicholas Witchell as “unprecedented”, the Queen. who also visited survivors of the Manchester bomb in hospital, said she had been “profoundly struck by the immediate inclination of people throughout the country to offer comfort and support to those in desperate need”.
She added: “United in our sadness, we are equally determined, without fear or favour, to support all those rebuilding lives so horribly affected by injury and loss.”
The fire, at broke out at the 24-storey block, which contained 120 one and two-bedroom flats, shortly before 01:00 BST on Wednesday.
It tore through all floors of the building and took more than 200 firefighters 24 hours to bring it under control.
Protests were held in London on Friday as residents demanded more support for those affected by the fire.
Between 50 and 60 people stormed Kensington and Chelsea Town Hall as members of the public said the homeless needed help “right now”.
There were also angry scenes outside the Clement James Centre, in North Kensington.
Dozens of demonstrators surged towards the entrance and there were scuffles outside as organisers appealed for calm.
The BBC’s Matthew Price said locals had told him they wanted the prime minister to “cut out” Kensington and Chelsea council from the relief effort.
He said senior members of the residents’ association described an “absolute chaos” of “no organisation” from officials.
He added: “They do not believe they are capable of managing the response. Such is the total and utter lack of trust.”-BBC