Prince Andrew may have once dated Ghislaine Maxwell, according to friends and a former royal protection officer who claims Jeffrey Epstein’s madam was constantly “in and out” of Buckingham Palace.

Former palace cop Paul Page said in a new documentary that Maxwell became a regular visitor from 2001, the year Andrew and his sex accuser, Virginia Roberts Giuffre, were photographed in Maxwell’s London home.

“From the way she was allowed to enter and exit the palace at will, we realized — suspected — that she may have had an intimate relationship with Prince Andrew,” Page said.

“A colleague of mine remembered her coming in four times in one day. She kept coming in and out, in and out,” he told the doc, “Ghislaine, Prince Andrew and the Pedophile,” set to air on Britain’s ITV in full on Tuesday.

A banker friend of Maxwell’s who socialized with the now-disgraced group shared the sentiment.

“I got the sense that Prince Andrew and Ghislaine had probably been girlfriend and boyfriend in the past,” Euan Rellie told the documentary, according to the Telegraph.

“They had an easy warmth around each other,” he said.

Rellie, who became friends with media heiress Maxwell at Cambridge University, recalled being invited to a dinner party in Epstein’s New York townhouse by Maxwell, who said it was “for my friend Prince Andrew.”

“She described Andrew as being her friend, not Jeffrey’s,” Rellie recalled.

The documentary also shows ITV’s Ranvir Singh calling a cellphone number found among a number of contacts for Andrew in Epstein and Maxwell’s now-notorious little black book.

“Hello … I think this might be Prince Andrew,” the reporter said after hearing a voicemail message she said sounded just like the middle son of Queen Elizabeth II.

“We found your number in the little black book and we’d like to have a chat with you,” she said, assuming it was the royal.

She looked shocked as she turned to her crew and said, “I mean, that sounded like Prince Andrew’s voice.”

Royal protection officer Page, meanwhile, also claimed that Andrew was known for having “50 or 60 stuffed toys” on his bed at the palace.

“If those bears weren’t put back in the right order by the maids, he would shout and scream and become very abusive,” claimed the ex-cop who worked in the Royalty and Specialist Protection Command for six years.

Andrew declined to comment, ITV said.

He is being sued by Giuffre, who has long claimed that Epstein and Maxwell made her have sex with him three times, starting when she was just 17.

Andrew has vehemently denied the allegations, which last week led to him being stripped of the title “His Royal Highness,” meaning he will fight the lawsuit as a private citizen.

Maxwell is still behind bars awaiting sentencing for sex-trafficking underage girls for late pedophile Epstein, whom she had also long dated. She is pushing for a mistrial amid revelations that jurors failed to disclose their own childhood abuse that they then used to sway deliberations.