In November, the F.B.I. provided the White House with additional information about the allegations.
Ms. Sanders insisted Tuesday that senior West Wing officials had not learned about the allegations against Mr. Porter until they surfaced in The Daily Mail because the F.B.I. gave the information to the White House Personnel Security Office, which handles security clearances. The office is in the Eisenhower Executive Office Building next door to the White House and is overseen by Joe Hagin, the deputy chief of staff.
Ms. Sanders said that the security office — which she repeatedly noted was staffed by “career officials,” who would not have been appointed by Mr. Trump — had not yet made a final determination on whether Mr. Porter should receive his security clearance at the time of The Mail’s article.
Still, pressed on whether senior officials — including John F. Kelly, the chief of staff; Donald F. McGahn II, the White House counsel; and Mr. Hagin — could have been unaware as far back as last summer that such a significant issue had been raised about one of the president’s closest aides, she conceded she could not be certain.
“Not that I’m aware of,” Ms. Sanders said. “I can’t say with 100 percent certainty.”
According to the two people briefed on the matter, the White House security office reviewed the allegations about Mr. Porter in July and saw that the F.B.I. had interviewed Mr. Porter’s two former wives but not Mr. Porter himself. The office asked the F.B.I. to go back and do so, said the two people, who spoke on the condition of anonymity because they were not authorized to discuss the case.
In November, the F.B.I. provided another report to the security office, the two people said, adding that at that point, a final review began to determine whether to grant Mr. Porter a security clearance. As part of that review, three officials in the personnel office, including its head, were supposed to come to their own conclusions about whether to grant the clearance, the people said.
By the time The Mail published its article last week, only one of those officials had made a determination, the two people said, although it is not clear what the official had concluded.
In late November last year, a distraught girlfriend of Mr. Porter’s contacted Mr. McGahn and told him Mr. Porter had been unfaithful to her by dating Hope Hicks, the White House communications director, and had anger problems, according to several people familiar with the discussion. Mr. McGahn, who knew Mr. Porter’s girlfriend, at that point suggested to Mr. Porter he should consider leaving the White House, the people said. But Mr. McGahn did not follow up on the matter.
One former White House official, Anthony Scaramucci, who lasted 10 days last year as White House communications director before being removed by Mr. Kelly, weighed in on Tuesday on Mr. Wray’s testimony. Mr. Scaramucci posted on Twitter that Mr. Kelly “almost certainly knew about credible allegations of domestic abuse against Rob Porter at least 6 months ago – then recently forced others to lie about that timeline.”
“Inexcusable,” Mr. Scaramucci added. “Kelly must resign.”
Ms. Sanders said Mr. Trump maintained confidence in Mr. Kelly, who told The Wall Street Journal on Tuesday that he had no regrets about how Mr. Porter’s case was handled, adding that “it was all done right.”
Mr. Porter, who as staff secretary handled all of the documents that made their way to the president, had in the weeks before the allegations been seeking an expanded portfolio in the West Wing, where experienced aides who can bring order to a chaotic operation are in short supply.
Mr. Trump’s aides initially said they had no inkling of the accusations against Mr. Porter until the reports in The Mail, and said they acted swiftly to terminate him when they discovered them. In fact, the White House spent the first hours after learning of the accusations — including the publication of photographs of one of Mr. Porter’s former wives with a black eye she said he had given her — defending Mr. Porter against the allegations and insisting that he was not being dismissed.
Even after Mr. Kelly changed his stance, calling the allegations vile and orchestrating Mr. Porter’s swift departure, the president has stuck up for Mr. Porter publicly, telling reporters that the situation had been “tough” and “sad” for Mr. Porter. The president insisted that Mr. Porter had denied the accusations, and wished him a successful career. On Tuesday, asked by reporters at a White House event with sheriffs if he had a message for victims of abuse, Mr. Trump declined to answer.
On Capitol Hill, lawmakers in both parties criticized how the White House had handled the episode.
“A lot of us are concerned about what has come to light in terms of these background checks — how long they take, how long somebody can be in an interim status and still have access to classified material,” said Senator Jeff Flake, Republican of Arizona. He said the scandal had exacerbated a generational divide that was already plaguing the party.
“Young people who have been walking away from the party are in a gallop right now, especially with what happened last week and just siding with the abuser,” Mr. Flake said. “That’s deadly.”
Senator Chuck Schumer, Democrat of New York, said Mr. Trump, who dispatched Ms. Sanders yesterday to denounce domestic violence but has not addressed the matter himself, had missed an opportunity.
“I haven’t heard the president say something directly about how bad domestic abuse is,” he told reporters on Tuesday. “You know, to have a spokesperson get out and say something is not good enough.”