Prince Philip made an audience laugh as he displayed his trademark humour before attending a New Year's Eve service in Sandringham.
He was cracking jokes to the Royals and guests walking with him towards the morning service at St Mary Magdalene church.
The Duke of Edinburgh joked with Alison Leggett, 54, of Hunstanton, Norfolk, after seeing her 18month old fox red labrador lying on the wet ground.
The 96-year-old pointed at her pet, saying: "I hope he hasn't got rising damp".
Prince Philip also reportedly made a joke about a man with a beard, prompting laughter from those who heard.
As he walked with Princess Anne, he pointed at the gentleman, who had long, ginger facial hair, he asked a bodyguard: "Is that a terrorist?"
An onlooker in the crowd said: "The man appeared to be his with wife and child. Philip was wishing lots of people a Happy New Year and then he spotted this guy with his distinctive beard.
"He pointed at him in a funny way and turned to one of his Royal bodyguards, saying: 'Is that a terrorist?.'
"He was obviously having a little joke, but he said it within earshot of the man who burst out laughing and appeared to find the whole thing hilarious. I think Philip knew he was going to be overheard.
"I'm sure Philip didn't mean any harm. His grandson Prince Harry has a ginger beard, so perhaps Philip had been cracking jokes about that over Christmas."
Ian Smith, 39, added: "Everyone knows Prince Philip has got a sense of humour, although some people night have though it was a risqué comment."
The Queen was among those walking into the church, but Prince Harry and Meghan Markle weren't seen at the service, and nor were the Duke or Duchess of Cambridge.
After the 50-minute service, at which the congregation sang the National Anthem and Christmas carols including It Came Upon the Midnight Clear, As With Gladness Men of Old and Hark the Herald Angels Sing, the Queen walked to her car as an audience applauded.
In quotes | Prince Philips gaffes
Prince Philip decided to be politically correct after he walked out of the church, and didn't make any more edgy remarks.
However, his attentions were again captured by a dog, this time a large rare breed Black Russian Terrier called Boris.
Neil Richards, 55, who owns the dog, explained: "Boris is an unusual dog and quite big. Philip asked what breed he was and when my wife said he was a Black Russian Terrier, he looked surprised and joked, 'A terrier?'
"It was nice that he spoke to us. It is a good example of his sense of humour. We brought Boris to see the Royals at the church two-years-ago, but nobody noticed him then."
Buckingham Palace declined to comment on Prince Philip's jokes.