WASHINGTON — President Donald Trump on Friday accused James Comey, the fired FBI director, of lying under oath to Congress, saying he would gladly provide sworn testimony disputing Comey's charge that the president forced him out because of his handling of the investigation into the Trump campaign's possible collusion with Russia.

Trump asserted that the comments Thursday by Comey, whom he called "a leaker," had proved that there was no collusion between his campaign and Moscow, nor any obstruction of justice by the president. He hinted again that he had tapes of his private talks with the former FBI chief that would disprove Comey's account, but declined to confirm the existence of any recordings.

"Yesterday showed no collusion, no obstruction," Trump said in the White House Rose Garden, during a news conference with the visiting Romanian president, Klaus Iohannis.

He dismissed Comey's testimony before the Senate Select Committee on Intelligence, which is investigating whether his campaign worked with Russia to sway the election, as a politically motivated stunt orchestrated by adversaries bitter about his victory in November.

"That was an excuse by the Democrats, who lost an election that some people think they shouldn't have lost," he said. "But we were very, very happy, and, frankly, James Comey confirmed a lot of what I said, and some of the things that he said just weren't true."

The remarks were a defiant response from Trump, who had remained uncharacteristically silent on social media during Comey's blockbuster day of testimony Thursday, as the former FBI chief laid out an account that strongly suggested the president's private exchanges with him had been an attempt to obstruct justice. They escalated an extraordinary public feud between a sitting president and the ousted FBI director who had been investigating his campaign, each now engaging in full-throated accusations that the other is lying.

But Trump's comments reflected a highly selective reading of Comey's testimony, much of which painted a damaging picture of the president's conduct. Comey told Congress that the president had not personally been under investigation while he was the FBI director, and that at one point Trump suggested he would like to find out whether any of his associates had done anything wrong. But his account also strongly suggested that Trump had tried to influence his handling of the Russia investigation.

Trump denied that he had ever asked Comey to drop the FBI investigation into his former national security adviser's dealings with Russia, or asked for a pledge of loyalty, as Comey asserted Thursday. Those conversations are reflected in memos Comey wrote, and now are in the possession of Robert Mueller, the special counsel in the Russia investigation who was named after Comey's firing.

"I didn't say that," Trump said of the request regarding the former national security adviser, Michael Flynn. "And there'd be nothing wrong if I did say it."

Of the loyalty pledge from Comey, Trump said, "I hardly know the man; I'm not going to ask him to pledge allegiance."

Asked whether he would be willing to provide his version under oath, Trump responded, "100 percent." He said of Mueller, "I would be glad to tell him exactly what I just told you."

The president declined repeatedly to say whether, as he suggested last month in a Twitter post, he had recordings of his conversations with Comey. "I'll tell you about it over a very short period of time," he said. "You're going to be very disappointed when you hear the answer."

The tantalizing comment appeared to catch the attention of congressional investigators participating in the Russia probe. Reps. Michael Conaway, R-Texas, and Adam Schiff, D-Calif., quickly announced they had written to Donald McGahn, the White House counsel, requesting that any recordings or memos about Trump's conversations with Comey be furnished to the intelligence committee within two weeks. They also said they had made a formal request to Comey for copies of the memos he testified about on Thursday or notes reflecting the meetings.

During his Senate testimony Thursday, Comey said he relished the idea of recordings of his conversations with Trump becoming public, saying, "Lordy, I hope there are tapes," and seeming to taunt the president at one point, remarking, "Release all the tapes — I'm good with it."

Comey testified that it was Trump's May 12 Twitter post suggesting there were such tapes that prompted him to ask an intermediary to give a reporter copies of the memos he had been keeping of his interactions with the president. The New York Times received copies and published an article based on one May 16, in which it was revealed that Trump had asked Comey to drop the Flynn matter.

Earlier Friday, Trump posted on Twitter that Comey had given him "vindication" in the Russia investigation.

"Despite so many false statements and lies, total and complete vindication," he wrote at 6:10 a.m.

He added, "and WOW, Comey is a leaker," referring to the former director's admission that he had orchestrated the leak of the contents of a memo detailing Oval Office discussions with the president to The New York Times through a friend.

The president also recirculated another defense of his actions posted on Twitter by Alan M. Dershowitz, a Harvard Law School professor emeritus who has advised the Trump team on Middle Eastern policy. "We should stop talking about obstruction of justice," Dershowitz said, linking to an interview he gave to Fox News. "No plausible case. We must distinguish crimes from pol sins."

Trump's team, led by his personal lawyer, Marc E. Kasowitz, on Friday was preparing a counterattack on Comey based in part on his admission that he arranged the leak of his account of the conversation with Trump in which he says the president suggested the FBI halt its investigation into Flynn.

The president's lawyers plan to file a complaint with the Justice Department inspector general next week arguing that Comey should not have shared what they call privileged communications, according to two people involved in the matter.

The lawyers also plan to send a complaint to the Senate Judiciary Committee raising questions about Comey's previous testimony to that panel. On May 3, in response to Sen. Chuck Grassley, R-Iowa, the committee chairman, Comey said he had never been an anonymous source for news outlets about the investigation involving Trump's team or authorized anyone at the FBI to be.

In his testimony Thursday, Comey said the memo whose contents he had a friend leak was not classified and therefore not inappropriate to make public. Trump's lawyers argue that it was subject to executive privilege, although the president has never asserted privilege over his conversations with Comey and independent legal experts have expressed doubt that he could. Comey arranged the leak May 15 after he was fired and after the May 3 hearing, so it would not be in direct conflict with that testimony.