Former FBI director James Comey says President Donald Trump asked him to investigate the salacious allegations from the so-called “dossier” to "prove that it didn't happen" and said it would be "terrible" if his wife Melania Trump would believe them to be true.

In an exclusive interview ahead of the April 17 release of his book “A Higher Loyalty: Truth, Lies and Leadership,” Comey told ABC News’ chief anchor George Stephanopoulos that he met with the president to discuss the unverified allegations that the then-reality television star engaged in a sexual encounter with prostitutes during a 2013 trip to Moscow.

The interview will air during a primetime "20/20" special on Sunday at 10 p.m. ET on ABC.

PHOTO: A Higher Loyalty: Truth, Lies, and Leadership by James Comey (Flatiron Books) More

Trump lashes out at former FBI director James Comey: 'LEAKER & LIAR'

Comey book claims President Trump sought loyalty like mafia boss 'Sammy the Bull's' induction ceremony

The “dossier,” a 35-page document containing raw intelligence complied by former British intelligence agent Christopher Steele, includes a detailed and graphic account of the alleged encounter and even raises the possibility that it could have been captured on video.

Comey says that during a private, one-on-one dinner with Trump on Jan. 27, 2017, Trump brought up the dossier and said, “He may want me to investigate it to prove that it didn't happen. And then he says something that distracted me because he said, you know, ‘If there's even a 1 percent chance my wife thinks that's true, that's terrible.’”

“‘And I remember thinking, ‘How could your wife think there's a 1 percent chance you were with prostitutes peeing on each other in Moscow?’ I'm a flawed human being, but there is literally zero chance that my wife would think that was true. So, what kind of marriage to what kind of man does your wife think [that] there's only a 99 percent chance you didn't do that?”

Comey said that Trump then told him, “I may order you to investigate that.” Comey said he preached caution.

“I said, ‘Sir, that's up to you. But you'd want to be careful about that, because it might create a narrative that we're investigating you personally, and second, it's very difficult to prove something didn't happen,’” Comey said.

PHOTO: President-elect Donald Trump calls on a reporter during a news conference in the lobby of Trump Tower in New York, Jan. 11, 2017. (Evan Vucci/AP FILE) More

Comey book claims Trump sought loyalty like 'Sammy the Bull's' induction ceremony

James Comey to give first interview to ABC News' George Stephanopoulos

Comey said that he first told Trump about the dossier several weeks earlier at a Jan. 6, 2017, meeting at Trump Tower in New York City, in a private, one-on-one conversation after a group of intelligence agency leaders had presented the president-elect with information about how the Russians had interfered with the 2016 election.

Trump appeared less concerned by the attack, Comey said, than by how it could undermine his victory.

“President-elect Trump’s first question was to confirm that it had no impact on the election … and then the conversation, to my surprise, moved into a PR conversation about how the Trump team would position this, and what they could say about this, with us still sitting there,” Comey said. “And the reason that was so striking to me [is] that’s just not done. That the intelligence community does intelligence, the White House does PR and spin.”

According to Comey, no one in the room that day asked what next steps should be taken to stop the Russians from executing a similar operation in the future.

Story continues