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.

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.

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.

“It was all, ‘What can we say about what they did and how it effects the election that we just had,’” Comey said.

Comey said he then asked to speak with the president-elect alone to discuss the information contained in the “dossier.”

“I'm about to meet with a person who doesn't know me, who's just been elected president of the United States, [and] by all accounts, and from my watching him during the campaign, could be volatile,” Comey said. “And I'm about to talk to him about allegations that he was involved with prostitutes in Moscow and that the Russians taped it and have leverage over him.”

The conversation, Comey said, was “really weird,” resulting in what the then-FBI director called an “almost out-of-body experience.”

“I was floating above myself, looking down, saying, ‘you're sitting here, briefing the incoming president of the United States about prostitutes in Moscow,’” Comey said.

Comey did not reveal to the president-elect at this time that the information had come to light through opposition research financed by his opponents, “because it wasn't necessary for my goal,” which was merely to alert him the FBI had obtained the information.

“I started to tell him about the allegation was that he had been involved with prostitutes in a hotel in Moscow in 2013 during the visit for the Miss Universe pageant and that the Russians had filmed the episode, and he interrupted very defensively and started talking about it, you know, ‘Do I look like a guy who needs hookers?’” Comey recalled. “And I assumed he was asking that rhetorically, I didn't answer that, and I just moved on and explained, ‘Sir, I'm not saying that we credit this, I'm not saying we believe it. We just thought it very important that you know.’”

Comey said he tried to tell Trump that he didn’t know if the allegations were true, but wanted to inform the president that the FBI had the information.

“I said … ‘I'm not saying that I believe the allegations, I'm not saying that I credit it,’” Comey said he told Trump. “I never said, ‘I don't believe it,’ because I couldn't say one way or another.”

But when asked if he believed Trump’s denials, Comey remembered being mostly stunned.

“I honestly never thought this words would come out of my mouth, but I don't know whether the current president of the United States was with prostitutes peeing on each other in Moscow in 2013,” he said. “It's possible, but I don't know.”

As of his firing, Comey said, the information remained “unverified.”