LONDON — President Trump denied on Tuesday that he knew Prince Andrew, the son of Queen Elizabeth II who has become entangled in sexual abuse accusations against the disgraced financier Jeffrey Epstein.

“I don’t know him, no,” the president told reporters gathered in London for the NATO summit.

But photographs show they have met several times over the past 20 years, and as recently as June when the prince, known formally as the Duke of York, hosted a breakfast meeting for Mr. Trump during his state visit to Britain. Those photos were posted on the prince’s Twitter account.

Mr. Trump also toured Westminster Abbey in London with the prince, and they were photographed laughing together.