U.S. President Donald Trump on Friday denied that he tried to block an FBI investigation into former national security adviser Michael Flynn, effectively accusing James Comey — the FBI's former director — of lying under oath to Congress.

Comey delivered scathing remarks about the president on Thursday at a congressional hearing and testified that Trump had asked him to drop a Federal Bureau of Investigation probe into former aide Michael Flynn and his alleged ties to Russia.

Trump says Comey's testimony also vindicated him from allegations that he colluded with Russian meddling in the 2016 U.S. presidential election.

"James Comey confirmed a lot of what I said. And some of the things that he said just weren't true," Trump said at an event in the White House Rose Garden.

Former FBI Director James Comey testified before a Senate intelligence committee hearing on Russia's alleged interference in the 2016 U.S. presidential election on Thursday. (Jonathan Ernst/Reuters)

Asked by a reporter if he had told Comey to drop the investigation into former national security adviser Flynn, Trump said, "I didn't say that."

The reporter then asked, "So he lied about that?"

"Well, I didn't say that. I mean, I will tell you, I didn't say that," Trump replied.

In his testimony, Comey also said Trump asked him in January to pledge loyalty to the president, an unusual request that would put in doubt the independence of the FBI.

"I hardly know the man. I'm not going to say I want you to pledge allegiance. Who would do that?" Trump said at joint news conference with Romanian President Klaus Iohannis.

Comey's testimony was the most eagerly anticipated U.S. congressional hearing in years. The issue of the Trump election campaign's relationship with Russia has dogged Trump's first months in office and distracted from his policy goals such as overhauling the U.S. healthcare system and making tax cuts.

Comey, who was fired by Trump in May, did not make any major disclosures about links between Trump or his associates and alleged Russian meddling.

Asked on Friday if he would be willing to go under oath to give his version of his interactions with Comey, Trump replied, "100 per cent."

He said he would be happy to speak to special counsel Robert Mueller, who is investigating allegations that Russia interfered with the election and colluded with Trump's campaign.

"I would be glad to tell him exactly what I just told you," Trump told a reporter.

Trump's offer to testify under oath would pit his word against Comey's before federal investigators.

House intelligence committee asks for tapes

Despite repeated questions from reporters, Trump refused to confirm whether tapes exist of his private conversations with Comey, saying only that he would speak to that in a "fairly short period of time." Trump had previously indicated via Twitter there were tapes, to which Comey responded during his testimony, "Lordy, I hope there are tapes."

The House of Representatives intelligence committee (separate from the Senate committee at which Comey testified) sent a letter on Friday to White House counsel asking whether there are any tapes or memos of conversations between Trump and Comey, The Associated Press reported.

The committee also sent a letter to Comey, asking for any notes or memos that would describe the discussions.

It has asked to receive the materials by June 23, AP reported.

Trump wrote earlier Friday on Twitter that the former FBI head had vindicated him by telling the Senate intelligence committee that the president had not been personally under investigation in the Russia probe.

Trump also castigated Comey as "a leaker" — first on Twitter and again later at the White House news conference — for giving an account of his conversation with the president to a law professor who shared it with a news outlet.

Despite so many false statements and lies, total and complete vindication...and WOW, Comey is a leaker! —@realDonaldTrump

During his testimony on Thursday, Comey said that he instigated the leak after Trump fired him in May, with the intention of making the information public and setting the wheels in motion for a special counsel to be appointed.

"Despite so many false statements and lies, total and complete vindication ... and WOW, Comey is a leaker!" Trump tweeted.