London suffered two deadly attacks, while 22 people were killed in a suicide bombing at Manchester Arena where USA singer Ariana Grande had been performing.
"This Christmas, I think of London and Manchester, whose powerful identities shone through over the past 12 months in the face of appalling attacks", said the monarch.
The Queen described a hospital visit immediately after the Manchester attack as "a privilege because the patients I met were an example to us all, showing extraordinary bravery and resilience".
In March, a terrorist plowed his vehicle into pedestrians on London's Westminster Bridge, killing four people, before stabbing a police officer to death outside Parliament.
Looking back over 2017, the Queen reflected fondly on her relationship with Prince Philip amid his decision to "slow down a little".
"We think of our homes of places of warmth, familiarity and love, of shared stories and memories which is perhaps why at this time of year so many return to where they grew up", she said.
Kulbhushan Jadhav's meeting with wife, mother obscured by glass screen, Pakistan propaganda
India acknowledges that Jadhav had served in the Indian Navy but denies that he has any connection with the government. From Pakistan's side, Foreign Office Director India Dr Fareha Bugti was present at the meeting.
Google's Eric Schmidt stepping down as executive chairman of Alphabet
In its announcement, Alphabet said that it anticipates the board will replace Schmidt with a non-executive chairman. Alphabet owns Google Search, Maps, Ads, Gmail, Android, Chrome and Youtube and has more than 70,000 employees.
Damian Green Was Fired by Theresa May For Lying, Jeremy Hunt Acknowledges
But Mr Hunt suggested Mr Green had been "pushed into a situation" where he said something he "didn't mean to say". Ms Maltby is not commenting on Mr Green's resignation until she receives more details from the Cabinet Office.
In an apparent reference to the couple's wedding next May, and the Duke and Duchess of Cambridge's baby, expected in April, the Queen said this Christmas her family '...look forward to welcoming new members into it next year'.
Flanked by pictures of great-grandchildren George and Charlotte in her Buckingham Palace home, the queen said "home" was the theme of this year's message. This is the first Christmas the family will be joined by Prince Harry's fiancee, American actress Meghan Markle.
This year's annual address has been produced by Sky News and was recorded in the palace's 1844 room which is decorated with a large tree and features family photos.
Our thoughts and prayer are with all those who died and those who lost so much, and we are indebted to members of the emergency services who risked their own lives this past year saving others.
He retired from regular royal duties over the summer, but has continued to make occasional appearances, most recently walking to the Christmas Eve church service on the royal family's Sandringham estate.
She said: "I don't know that anyone had invented the term 'platinum" for a 70th wedding anniversary when I was born.