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."
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 Saturday's message the Queen said: "Today is a traditional day of celebration. This year, however, it is very difficult to escape a very sombre national mood."
She said: "During recent visits in Manchester and London, I have 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.
He said: "People are incredibly angry, they're bewildered, they're confused, they have lots and lots of questions. They feel they're not being listened to and what they have been saying has not been listened to, and they don't know how to be able to express those things at the moment."
Mrs May has faced criticism for not meeting survivors in the immediate aftermath, unlike Labour leader Jeremy Corbyn and Mayor of London Sadiq Khan.
Mr Corbyn has written an open letter to the prime minister, calling for the public inquiry to ensure "all necessary lessons are learned".
The prime minister has committed £5m for clothes, food and emergency supplies but was heckled with chants of "coward" after meeting survivors of the fire on Friday.
The £5m Grenfell Tower Residents' Discretionary Fund includes the aim to re-house residents within three weeks as close to where they lived before as possible, to pay for temporary housing in the meantime and to provide extra financial assistance.
"The government is making money available, we are ensuring we are going to get to the bottom of what has happened, we will ensure that people are re-housed. We need to make sure that actually happens."
Asked whether she had misjudged the public mood, she said: "This was a terrible tragedy that took place.
"People have lost their lives and others have lost everything. What we are doing is putting in place the support that will help them."
First Secretary of State Damian Green said the prime minister understood the mood of the public and that criticism of her was "unfair".
He told BBC Breakfast: "She is as distraught as anyone, as all of us are, we all feel the sadness, we all recognise the anger and can see why people are that angry and the prime minister feels that as much as anyone."
He added that she had listened to residents' concerns and was "acting on those concerns as quickly as possible".
On Friday night, hundreds of mourners stood arm in arm at a vigil and held a two-minute silence for victims of the fire.
Many wept openly as candles illuminated the road outside the Latymer Christian Centre, yards from the site of the blaze.
It came after emergency services spent a third day searching for bodies in the burnt-out tower in North Kensington.
The Syria Solidarity Campaign said Mr Alhajali, a civil engineering student, had been in a flat on the 14th floor when the fire broke out, and had spent two hours on the phone to a friend in Syria.
Five-year-old Isaac Shawo reportedly got separated from his family in the smoke and later died.
Artist and photographer Khadija Saye, 24, lived on the 20th floor and also died.