‘I Don’t Know Prince Andrew,’ Trump Says. Photos Say Otherwise.

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. But photographs show they have met several times over the past 20 years.

“I don’t know Prince Andrew, but it’s a tough story,” Mr. Trump told reporters while visiting London for a NATO meeting, adding: “I don’t know him, no.”

Mr. Trump’s account was undermined by several photographs from years ago showing the two men together, as well as a tweet in June from Prince Andrew, the man who the president said he did not know.

Prince Andrew, known formally as the Duke of York, hosted a breakfast meeting for Mr. Trump during the president’s state visit to Britain earlier this year, and posted images from the event on his official Twitter account.

The prince, who is the queen’s third child, announced last month that he was stepping back from public life after a disastrous television interview in which he tried to defend his connection to Mr. Epstein and said he had no recollection of Virginia Roberts Giuffre, who has testified that she was ordered to have sex with the prince in 2001 while being employed by Mr. Epstein.

Ms. Giuffre, who has also spoken publicly about being abused by Mr. Epstein, reiterated the accusations in a British television interview of her own on Monday. The prince has denied any wrongdoing in his interactions with Mr. Epstein, who was jailed for 13 months in 2008 on a charge of soliciting prostitution from a minor. The financier hanged himself in a Manhattan jail in August while awaiting trial on new sex-trafficking charges.

The “I don’t know him” formulation is one that Mr. Trump has often reached for when asked about people whom it has become painful or perilous to discuss, including Matthew G. Whitaker, his rejected choice for attorney general; and Gordon D. Sondland, his ambassador to the European Union.

During his state visit to Britain in June, Mr. Trump toured Westminster Abbey in London with the prince, and they were photographed laughing together.

Mr. Trump and his then-girlfriend, Melania Knauss — who is now the first lady — were seen with the prince at least twice in 2000: once at the opening of Hudson Hotel in New York and, more intimately, at Mr. Trump’s Mar-a-Lago estate in Florida.

Another photograph said to have been taken the same night shows the couple with Mr. Epstein and Ghislaine Maxwell, Mr. Epstein’s onetime girlfriend who has been accused of overseeing efforts to procure girls and young women for him, a charge that she has firmly denied.

Mr. Trump, whose friendship is considered a potential liability to Prime Minister Boris Johnson in Britain’s Dec. 12 general election, also told reporters on Tuesday that he did not know anything about Jeremy Corbyn, the leader of the opposition Labour Party and Mr. Johnson’s main rival in the election.

“Jeremy Corbyn?” Mr. Trump said. “Know nothing about him.”

The president had given an opinion on Mr. Corbyn as recently as last month, on a London-based radio show hosted by Nigel Farage, a British politician who had spearheaded the campaign for Britain to leave the European Union.

“Corbyn would be so bad for your country, he’d be so bad, he’d take you in such a bad way,” Mr. Trump said. “He’d take you into such bad places.”