(Jenny Starrs/The Washington Post)

Dueling accounts emerged Friday of private conversations between fired FBI director James B. Comey and President Trump, who suggested that there may be “tapes’’ of the discussions in which he said Comey told him he was not under investigation.

Comey associates said he was wary of private meetings and discussions with the president and did not offer the assurance, as Trump has claimed, that Trump was not under investigation as part of the probe into Russian interference in last year’s presidential election.

“James Comey better hope that there are no ‘tapes’ of our conversations before he starts leaking to the press!” the president tweeted Friday morning, raising the prospect that the president or his staff may have secretly recorded the FBI director during phone calls or a one-on-one dinner.

But it’s also possible that Comey created a written record of the conversations after the fact — something he has done in the past when he’s been involved in sensitive discussions about tough legal or ethical issues, according to people who have worked with him.

White House spokesman Sean Spicer declined to explain whether the president records his conversations. “The president has nothing further to add on that,” said Spicer, who denied that the tweet was meant to intimidate. “That’s not a threat, he simply stated a fact.”

In the wake of Trump’s statements, congressional Democrats demanded any recordings of conversations between Trump and Comey.

Since abruptly firing Comey on Tuesday, the president has claimed that Comey repeatedly told him he was not under investigation. He also said Comey requested the January dinner meeting at which he asked to keep his job in the new administration.

Associates of Comey, however, sharply dispute Trump’s version of events.

Comey got an invitation to a late-night dinner at the White House on Jan. 27, one week after the inauguration. The director, associates said, did not want to go because he was wary of any appearance of impropriety, but he felt like he should.

“It’s kind of hard to say no to your commander in chief,” said one Comey associate. “He certainly didn’t go over there to ask to keep his job.”

Comey also didn’t want word of the dinner to get out because “he was worried about the public perception,” the associate said.

(Whitney Shefte/The Washington Post)

A second Comey associate said Trump pressed the FBI director to pledge his loyalty to the president, but Comey demurred. Those details were first reported by the New York Times, in an article that may have prompted Trump’s tweet Friday about tapes and leaks. White House officials deny that the president sought a pledge of loyalty from Comey.

Associates of Comey were indignant that the president reportedly expected a pledge of loyalty from the head of an agency that has long sought to maintain a stark degree of independence. And they dismissed the notion that a tape of the conversation would hurt Comey.

“In that matchup, I sure know where I’d put my money — the longtime prosecutor running the FBI,’’ said a third Comey associate.

The first associate said: “First of all, he’s a lawyer and a prosecutor, so he understands the legal limits. He’s got a strong ethical and moral compass. He’s also always been careful in conversations about what he can say and can’t say.’’

That associate also discounted the suggestion by Trump that Comey should stop “leaking.’’

“First of all, a private citizen can go say whatever he wants to the media,” the associate said, adding that an illegal leak involves classified information, not details of conversations that happen in the government.

The entire issue of leaks has been a sore point between the White House and the FBI, according to current and former officials. Trump administration officials have complained to the FBI for months about leaks and have urged the bureau to be more aggressive in hunting the sources of such information, according to people familiar with the discussions. FBI officials are investigating some leaks of classified material but have resisted pressure from the administration to probe nonclassified matters, these people said.

The first Comey associate also said the president does not appear to understand that “Comey’s not the one driving” the Russia probe. “It’s an investigation that’s on record. You’re not going to just shut it down by firing the FBI director.”

Comey has declined a request to testify next week behind closed doors to the Senate Intelligence Committee. Sen. Mark R. Warner (Va.), the ranking Democrat on the committee, told MSNBC that “it’s our hope in the not-too-distant future that we can find time for him to come in.”

A key player in Comey’s firing, Deputy Attorney General Rod J. Rosenstein, has agreed to appear before the full Senate next week, though it’s unclear whether that session will be public or private.

Rosenstein has come under intense criticism from Democrats for writing a memo criticizing Comey for his handling of the Hillary Clinton email investigation — a document that was initially cited by White House officials as the reason for Comey’s ouster, before Trump acknowledged that he had already planned to fire the director.

While it had been reported that Comey’s firing came days after he asked Rosenstein for more resources for the Russia probe, a person with direct knowledge of the matter said that Comey did not make that request, and that the investigation had and continues to have all the personnel and resources it needs.

Comey was less than four years into his 10-year term as director when he was dismissed. The president can fire an FBI director at any time for any reason, but because of the agency’s long tradition of independence from politics, presidents tend to refrain from doing so. Comey’s firing raised particular alarms among Democrats who fear that it will weaken the bureau’s independence as it investigates whether any Trump associates coordinated with Russian officials during last year’s election.

Since Comey’s firing Tuesday, his deputy, Andrew McCabe, has been running the FBI as the acting director. Initially, officials said they were interviewing a handful of candidates to immediately take over as acting director while the White House searched for a nominee. On Friday, however, officials indicated that Mc­Cabe is likely to remain awhile longer, at least into next week.

Officials said four candidates for FBI director would be interviewed Saturday: McCabe, Sen. John Cornyn (R-Tex.), lawyer Alice Fisher and appeals court judge Michael Garcia.

Former New York mayor Rudolph W. Giuliani, whose name was also floated, said in an earlier interview that he would not be a candidate.

“I’ll tell you the exact reason — I’m too much of a partisan. I think the next director should be somebody who is generally nonpartisan,” Giuliani said. “I wouldn’t see me fitting the profile, for the reason that I was such a strong supporter of the president.”

Matt Zapotosky contributed to this report.