WASHINGTON — President Trump dipped in and out of the small dining room off the Oval Office on Thursday to monitor a television as James B. Comey, the ousted F.B.I. director, told a tortured tale — and to insist to his huddled legal team, “I was right.”
Many Democrats and some legal analysts predicted big trouble for the president after Mr. Comey’s blow-by-blow description to the Senate Intelligence Committee of Mr. Trump’s efforts to steer the investigation of his former national security adviser, Michael T. Flynn, behavior they think amounted to obstruction of justice.
But Mr. Trump and many of his aides believe that Mr. Comey’s unexpected admission that he leaked details of private Oval Office discussions to the news media, along with questions he raised about the conduct of Loretta Lynch, President Barack Obama’s second attorney general, has given them fresh ammunition for a political counterattack that Mr. Trump badly wants to wage.
“We know how to fight better than anybody, and we never, ever give up — we are winners — and we are going to fight,” Mr. Trump told a conference of conservative evangelicals after he left the West Wing for a brief public appearance, just as Mr. Comey was wrapping up his nearly three hours of testimony.
Mr. Trump’s default defiance masked a deep anxiety and anger, described by people close to him in recent days, that are anything but typical for even the most disruptive of presidents. But that eventually gave way to a sense of relief, however temporary, as Mr. Comey confirmed the president’s insistence that Mr. Comey had repeatedly told him that he was not personally under investigation in the inquiry into Russian election interference.
In all, Mr. Trump watched only about 45 minutes of Mr. Comey’s testimony, the people close to the president said. Much of that time was spent under the eye of his take-charge personal lawyer, Marc E. Kasowitz, and Defense Secretary Jim Mattis, one of the cabinet members he trusts most.
This was by design, with the president’s tacit consent. His aides packed the day with meetings and speechwriting sessions, including a 90-minute sit-down focusing on North Korea, Qatar and the terrorist attacks in Iran with the national security adviser, H. R. McMaster; Secretary of State Rex W. Tillerson; and Mr. Mattis.
The idea: Keep Mr. Trump occupied, even-keeled and away from Twitter.
Mr. Trump, according to two people in his orbit, was preoccupied, uncharacteristically impassive but in generally decent spirits. Most of his aides studiously avoided the topic of the hearing, under instruction from Mr. Kasowitz, who is trying to close the circle of decision-making on the matter and stem a tide of leaks.
Mr. Trump’s aides were also acutely conscious of treading lightly to avoid agitating the president, who has been in a sour and combative mood all week, according to two people close to the president.
The president was uncharacteristically disciplined, leaving for his speech at the Faith and Freedom Coalition event sharply at noon, even while Mr. Comey’s hearing had 30 more minutes to go. Mr. Trump breezed out of the Oval Office without any expression of interest in lingering.
There was pleasure among White House aides with how Republican senators — who largely avoided taking on the president — performed in the hearing. The president, who is prone to murmuring while watching television, said at least once that he had been right about the Hillary Clinton email investigation — Mr. Comey said he had been uncomfortable when Ms. Lynch asked him to refer to the criminal inquiry as a “matter” — as well as that Mr. Comey was a self-promoter.
His top advisers, especially his chief strategist, Stephen K. Bannon, were worried that the president would defy Mr. Kasowitz and take to Twitter to vent his pique with Mr. Comey, who he believes is on a personal mission to destroy his presidency. West Wing staff members expressed relief when the president’s Twitter feed remained quiet even after Mr. Comey accused him of telling “lies, plain and simple,” in an effort to smear his reputation and that of the bureau.
The relief, they fear, might be short-lived. Aides were bracing for some kind of Twitter eruption on Thursday night or early Friday. Aides expected the president to either watch the full hearing later in the day on TiVo, or — potentially worse — simply skip to coverage on Fox News or CNN, where Mr. Comey’s most damaging comments were playing on a loop.
The mood in the West Wing, which has taken on an increasingly apprehensive edge as the Russia investigation has intensified, was especially tense on Thursday as Mr. Comey spoke, despite a claim by a Trump spokeswoman, Sarah Huckabee Sanders, in an off-camera briefing at midday that “it’s a regular Thursday at the White House.”
Staff members gathered around TV sets and winced at Mr. Comey’s statements, but shifted immediately when Mr. Comey, to their surprise, revealed that he had fed a memo to The New York Times through an intermediary to prompt the appointment of a special counsel.
Mr. Trump’s team was equally surprised, and encouraged, when Mr. Comey questioned Ms. Lynch’s actions in the investigation into Mrs. Clinton’s use of a private email server. Ms. Lynch asked him to call it a “matter” to protect Mrs. Clinton, a fellow Democrat, Mr. Comey suggested.
But the sugar highs of Mr. Trump’s early days in office have subsided, and there was no high-fiving or expressions of relief. Staff members, especially in the beleaguered White House press office, have become suspicious that leakers might relay their comments to reporters, and Mr. Kasowitz has met with many top staff members to advise them against discussing issues facing the president, even relatively innocuous ones, telling one aide, “Leave everything to me.”
For their part, many of Mr. Trump’s aides were less than impressed by the public performance of Mr. Kasowitz, a lawyer based in New York who has earned the president’s respect and, for the moment, his situational obedience. A hastily drafted initial statement to the news media contained typos — “president” was misspelled — and he delivered it in a harried monotone, staring down at his text, to reporters gathered at the National Press Club.
Gradually, however, the concerns of any single news cycle are giving way to longer-term worries about the course of the investigation, and several West Wing aides have expressed concern about the possibility of being blindsided by new revelations.
Several current and former Trump aides said they were especially concerned about Mr. Kasowitz’s unqualified assertion that the president had “never told Mr. Comey, ‘I need loyalty, I expect loyalty,’” as Mr. Comey said on Thursday.
“I can’t believe they are worried about public opinion on a day like this, when Comey set so many perjury traps for them,” said Jennifer Palmieri, a veteran Democratic operative who served as Mrs. Clinton’s communications director during the 2016 campaign.
“Communications and news cycles don’t matter — they don’t know what is going to hit them,” added Ms. Palmieri, who served in the White House during President Bill Clinton’s impeachment. “They are still telling the president what he wants to hear, and that’s extraordinarily dangerous.”