WASHINGTON — President Donald Trump said Friday that he would be “100 percent” willing to testify under oath in the government’s Russia probe, and asserted that fired FBI Director James B. Comey lied in telling Congress that Trump asked him to swear loyalty and to drop an investigation into former national security adviser Michael Flynn.

“No collusion. No obstruction. He’s a leaker,” Trump said of Comey during a Rose Garden news conference with Romanian President Klaus Iohannis. “But we want to get back to running our great country.”

No president has been compelled to testify in public —former President Bill Clinton testified privately in a civil suit, though his testimony later became public —and Congress most likely could not require Trump’s testimony. Trump said that he would be willing to answer questions from the special counsel, Robert S. Mueller III, who is running the investigation into Russian meddling in the 2016 election and possible coordination with the Trump campaign.

The president’s comments, and an anti-Comey tweet Friday morning, were Trump’s counter to Comey’s dramatic, nationally televised testimony Thursday to the Senate Intelligence Committee. Several times Comey called Trump a liar, said the president presumably fired him because of his Russia investigation and described possible obstruction of justice, including a request from Trump to let go of the probe of Flynn’s contacts with Russia.

“I didn’t say that,” Trump said. “And there’d be nothing wrong if I did say it.”

The president had started his day with a tweet even more forcefully attacking Comey. “Despite so many false statements and lies, total and complete vindication ... and WOW, Comey is a leaker!” he wrote.

Even as Trump seemed to accuse his former FBI director of perjury, the president seized on other parts of Comey’s hours of testimony as validation of his own insistence that he did nothing wrong. Trump’s claim of vindication, trumpeted by his White House and the Republican Party apparatus, was a message of reassurance to his loyal base.

More broadly, that reflects the president’s stepped-up strategy of relying increasingly on those core supporters, in hopes of preventing Republican lawmakers from abandoning him.

Trump is getting plenty of help from friendly media outlets favored by his supporters. Hours after Comey’s appearance Thursday, Fox News host Sean Hannity conducted a prime-time interview with Donald Trump Jr. in which both men reinforced the administration’s arguments.

Trump and his allies have focused on Comey’s statement that Trump was not, at the time of their meetings and phone conversations, the subject of an FBI investigation —ignoring Comey’s testimony that he declined to publicize that fact, as the president requested, in case Trump later did come under scrutiny.

With Comey’s firing last month, and the subsequent appointment of a special counsel to lead the Russia investigation, Trump lost whatever tacit control he had of the probe, leaving him to instead focus on the politics around it.

But the political strategy suddenly is a gamble. Lawmakers could turn on Trump if the investigation unearths more damaging material. His reduced leverage amid the controversies is among the problems stalling his legislative agenda, and policy failures could in turn diminish the president’s support among conservatives. Political experts are unsure of the true size of Trump’s base of committed supporters, a factor that will be key to whether GOP lawmakers defect.

“We are in uncharted territory with this president. We’ve never had anyone like him in 227 years,” said Whit Ayres, a Republican pollster who works for many members of Congress whose political fates are tied to Trump’s. “Uncharted territory gives everyone a bit of agita.”

Trump, who won the election with 46 percent of the popular vote, was already operating on a thin political margin, though his support in heavily gerrymandered House districts has been significantly higher. His national job-approval ratings have since dropped and sat at about 40 percent before Comey’s testimony.

Trump’s job approval among Republican voters remains high, though there is evidence in recent polls that some of his supporters, particularly in suburbs, have shown signs of wavering.

But even lawmakers most loyal to Trump add caveats to their support. During a gathering of evangelical Christians in Washington known as the Faith & Freedom conference, held across town during Comey’s testimony Thursday, Sen. David Perdue, R-Ga., offered a typical endorsement.

“This president is nobody’s choir boy, right?” Perdue said, eliciting laughs from the crowd. “But he is a man of action.”

Sen. Ted Cruz, R-Texas, speaking at the same conference, emphasized the need to pass conservative laws and appoint conservative judges, mentioning Trump just once as he praised the president for nominating Neil M. Gorsuch to the Supreme Court.

Trump, who followed the two senators, drew sustained applause when he mentioned Gorsuch, an accomplishment that unites Republicans of all stripes. Indeed, especially as Trump’s legislative agenda founders in Congress, his commitment to name conservative judges to federal courts at all levels is the single strongest bonding agent he has for holding Republicans together —just as it was the deciding factor for many skeptical Republicans in voting for Trump last November.

Trump, at the conference, spoke in detail about his support from evangelicals during the campaign, enumerating the doors they knocked on and the calls they made. He urged them to stay behind him. He aligned his political fight with theirs for “your right and the right of all Americans to follow and to live by the teachings of their faith.”

“As you know, we’re under siege, you understand that, but we will come out bigger, better and stronger than ever,” he said.

It’s common for presidents to focus on their core supporters, even those facing fewer challenges than Trump. Clinton, facing impeachment and removal from office by a Republican-controlled Congress, drew closer to his liberal base in his second term, after initial years of forging a more moderate, fiscally conservative path for his party.

Trump cast his lot with his conservative base from the outset, starting his term with executive actions appealing to his core supporters and initiating a legislative agenda with little effort at luring Democrats. He also has exploited an advantage unavailable until recent years: a conservative media system that acts as a direct conduit to conservative voters, continually sowing doubt about news reported by the mainstream media and promoting Trump’s version of the facts.

“Richard Nixon never enjoyed anything like this,” said Charlie Sykes, a former conservative radio host who has been critical of what he calls the “pro-Trump media ecosystem.”

The Republican National Committee has accelerated its efforts to back Trump as well. It circulated talking points before, during and after Comey’s testimony, and has been working to rally rank-and-file voters around the claim that Comey’s testimony vindicated Trump.

Rick Gorka, a spokesman for the party, denied that the message is aimed solely at core Republicans. He said the GOP is also emphasizing Democratic political obstruction, arguing that Democrats are using the Comey investigation as a reason to block Trump’s legislative agenda and re-litigate the election.

“The election is over,” Gorka said.

That argument will likely carry over into midterm congressional elections next year. Currently, however, Republicans are fretfully awaiting results of a hard-fought congressional runoff this month in Georgia, where a Democrat has a strong chance of winning a traditionally Republican seat.

But already, the fact that the Georgia race is so competitive is being taken as a sign of Trump’s potentially negative impact on some congressional elections.

“The president is unable to drive an agenda that is not, at this point frankly, dedicated to his own self-preservation,” said Reed Galen, a Republican consultant who has been critical of Trump.