Rudy Giuliani said Wednesday night that President Donald Trummp's motive for firing FBI Director James Comey nearly a year ago was that Comey would not say he wasn't a target of an investigation into potential collusion between Russia and the Republican's campaign.

"He fired Comey because Comey would not — among other things — say that he wasn't a target of the investigation," said Giuliani, who last month joined Trump's legal team addressing special counsel Robert Mueller's Russia probe.

"He fired him and he said, 'I'm free of this guy,'" Giuliani said of Trump's dismissal of Comey.

Giuliani, a former federal prosecutor and mayor of New York, made the remarks in a wide-ranging interview with Fox News host Sean Hannity.

Trump fired Comey as FBI director on May 9 last year. Comey has said and written about prior discussions with Trump in which the former FBI boss says the president sought personal loyalty. Trump also requested Comey let go a federal investigation into former national security advisor Mike Flynn.

Trump has denied Comey's assertions.

The administration has said Trump fired Comey over his handling of the investigations into Hillary Clinton during the campaign.

But in an interview with NBC News' Lester Holt that aired two days after Trump fired Comey, the president said: "When I decided to just do it, I said to myself, I said, 'You know, this Russia thing with Trump and Russia is a made-up story.'"

Deputy Attorney General Rod Rosenstein appointed Mueller, Comey's predecessor as FBI director, to take over the Russia probe after Trump fired Comey. Attorney General Jeff Sessions had recused himself from the investigation.

Trump has often slammed Mueller, Sessions and Rosenstein, while calling the probe a "witch hunt." He has also repeatedly denied any collusion took place.

Representatives for the White House did not immediately respond to CNBC's request for comment.

—CNBC's Christina Wilkie contributed to this report.