Queen Elizabeth joked an intruder armed with a crossbow had "put a dampner" on her Christmas celebrations.
The late monarch - who died in September aged 96 - was at home in Windsor Castle but didn't have contact with a man was arrested just 500 yards from her private apartments on 25 December last year.
However, when she was told about the alarming incident, the quick-witted queen was ready with a joke.
Gyles Brandreth revealed in his new book 'Elizabeth: An Intimate Portrait': "Throughout her reign, she took the possibility of being in the firing line in her stride.
"At Christmas 2021, when the Queen was 95, a masked and hooded intruder wielding a crossbow approached a police officer in the grounds of Windsor Castle and announced he had come ‘to kill the Queen’.
"He was arrested and charged under the 1842 Treason Act.
"When the Queen was told about the incident, she said to one of her team in the Windsor Covid ‘bubble’: ‘Yes, well, that would have put a dampner on Christmas, wouldn’t it?’ "
The author, who was a friend of the late Duke of Edinburgh, celebrated the queen's dry wit, love of jokes, and a surprising talent for impressions.
In an extract shared by MailOnline, he wrote: "The fun of spending time with the Queen was finding out how much fun she was and discovering unexpected things about her.
"She really could sing ‘When I’m cleaning winders’ and the other songs George Formby sang to his banjolele when she was growing up during the war – and with Formby’s authentic Lancashire accent, too. (She was the Duke of Lancaster, after all.)
"Her fondness for practical jokes is well known, as when she wore a false ginger beard to greet Prince Philip on his return from a world tour – during which he’d been photographed sporting a full set of whiskers.
"Those close to the Queen also speak of the many spot-on impressions she did (including an alarmingly accurate vocal recreation of Concorde coming in to land over Windsor Castle).
"But it was her wry, dry, humorous way of looking at things that particularly struck me, and her appreciation of jokes."