President Donald Trump wanted James Comey to investigate the infamous “pee tape” allegations — to reassure Melania that he hadn’t actually paid Russian hookers to urinate on a hotel bed, the former FBI chief claims in his upcoming book.

“He brought up what he called the ‘golden showers thing’ … adding that it bothered him if there was ‘even a one percent chance’ his wife, Melania, thought it was true,” Comey writes in “A Higher Loyalty: Truth, Lies, and Leadership,” a copy of which was obtained by The Post.

“He just rolled on, unprompted, explaining why it couldn’t possibly be true, ending by saying he was thinking of asking me to investigate the allegation to prove it was a lie. I said it was up to him.”

Read: How Republicans are planning to discredit Comey

The conversation took place during the same private dinner on Jan. 27, 2017, where Comey as claims the president demanded “loyalty” — and just days after the publication of an intelligence dossier alleging that the Kremlin had a tape of Trump paying prostitutes to perform the dirty deed on a bed once occupied by President Barack Obama.

Comey says he warned Trump an investigation might “create a narrative that we were investigating him personally,” the former top G-man writes.

Also see: James Comey is about to ‘shock the president and his team’

The president replied that he “might be right” — but kept asking him to consider the idea, and said he would as well, according to Comey.

Comey said he privately wondered why Melania might think there was even a 1 percent chance the allegations were true, claiming there is “zero chance” his own wife would believe such a claim.

“In what kind of marriage, to what kind of man, does a spouse conclude there is only a 99 percent chance her husband didn’t do that?” he writes in the book, which hits shelves April 17.

This report originally appeared on NYPost.com.