Prince Andrew claims his scandalous 2010 trip to see Jeffrey Epstein in New York was actually to end his decades-long friendship with the depraved pedophile, according to a report Sunday.

The Duke of York had been caught strolling in Central Park with Epstein as well as peeking out the front door of his sprawling Upper East Side mansion — even though Epstein had already done jail time for sex with a minor.

But the 59-year-old prince has been telling friends that the 2010 trip is being wildly misinterpreted — because he was only there to finally sever ties, sources told The Sunday Times of London.

“The duke has been hammered for one mistake, which took place in 2010,” a senior source close to Andrew told the paper.

“He has apologized again and again for the error of judgment. But what he did wasn’t criminal. It was a mistake.

“He went to see a friend to tell them he couldn’t be their friend any more,” the source insisted.

Still, the breakup did not appear too painful — with Andrew seen grinning happily as he waved goodbye to a female visitor to Epstein’s mansion, and his host throwing him a celebrity-packed party. Guests included Woody Allen, Katie Couric, Charlie Rose and George Stephanopoulos, The Post reported a few months later.

Authorities later found a “vast trove of lewd photographs” and child porn at the mansion where the British royal stayed.

The prince never spoke out against Epstein until after his death in a Manhattan lockup in August — but he now conceded he was an “undercover” pedophile, the source claims.

He even compared him to Jimmy Savile, a BBC TV and radio star who after his death was revealed to have raped and sexually assaulted hundreds of victims, the source told The Sunday Times.

“Every example of anyone behaving like Epstein, who has later been discovered, has actually been very good at keeping their cover,” the source told The Sunday Times.

“If you have someone like the duke, you probably don’t show that side of yourself to him.

“That’s the sadness of being someone like the duke, you sometimes don’t see the real person because you are a bit of a trophy friend.”

Andrew in August finally admitted it was “a mistake and an error” to have seen Epstein during that trip.

“At no stage during the limited time I spent with him did I see, witness or suspect any behavior of the sort that subsequently led to his arrest and conviction,” he said at the time.

Andrew has always categorically denied “abhorrent” claims that he also had sex with any of Epstein’s victims.

The FBI is reportedly refusing to give Andrew special treatment just because he is a royal as the Epstein investigation expands after the money man’s death.