President Donald Trump's sour relationship with recently axed FBI Director James Comey just got worse.

The president threatened Comey on Twitter just days after firing him in a surprise move earlier this week.

Donald Trump Tweet: James Comey better hope that there are no "tapes" of our conversations before he starts leaking to the press!

Trump fired Comey on Tuesday, and the president said in an NBC News exclusive interview on Thursday that he had been planning to do so regardless of what the Department of Justice recommended.

In his tweet, Trump appeared to be alluding to his own assertion in the NBC interview that Comey approached him with a dinner request in January, and that the then-FBI director told the president during the meal that Trump was not the subject of any FBI investigations. But current and former FBI officials told NBC News late Thursday that it was Trump, not Comey, who requested the dinner, and that in any event Comey would never divulge whether the president was being investigated.

Comey has not spoken publicly since his firing, and Trump did not indicate why he thinks it is necessary to head off any "leaking" from the former FBI chief. The president also did not indicate who he believes may have recorded the two men's conversation.

The District of Columbia has a "one-party consent" law, meaning it is not a crime to tape a phone call or conversation as long as one person in the conversation is aware that he or she is being recorded.

The White House has drawn criticism for the timing of Comey's firing, which occurred as the FBI continued to investigate Russian interference in the 2016 election and possible connections with the Trump campaign.

—CNBC's Ted Kemp contributed to this report.