by Julie Hirschfeld Davis and Michael D. Shear

WASHINGTON — The White House changed its story on Tuesday about how it handled allegations of spousal abuse against Rob Porter, the staff secretary who resigned in disgrace last week, conceding that the FBI told White House career officials last summer about problems in Porter’s background check. But members of President Donald Trump’s team said top advisers in the West Wing were kept in the dark.

The White House revised its version of events after testimony on Capitol Hill from FBI Director Christopher A. Wray contradicted earlier and shifting claims from the West Wing.

At a previously scheduled Senate hearing on Tuesday about threats against the United States, Wray, in response to a question about Porter, said the FBI had given the White House final results in January of its background investigation into the former staff secretary. Wray’s account was directly at odds with previous assertions by Sarah Huckabee Sanders, the White House press secretary, and other White House officials who said Porter’s background check was still underway when the domestic violence abuse allegations from his two former wives came to light last week in news reports.

Wray’s words strongly suggested that Porter, who had been given an interim security clearance, was allowed to continue serving in his influential post in the West Wing long after officials had received word of the troublesome accusations. Wray’s testimony also raised questions about the credibility of Trump’s most senior advisers and the degree of tolerance they may have shown to a colleague apparently eager to cover up a past. Three officials confirmed late Tuesday that the practice of giving interim security clearances to new hires in the White House was halted last fall by Trump’s chief of staff. Politico first reported the change.

According to Wray, the FBI updated the White House three times in 2017 — in March, July and November — about Porter’s background check as it progressed. Wray did not disclose the information that was given to the White House at those times, but according to two people briefed on the matter, the FBI first provided the White House in July with a rundown of the spousal abuse allegations the bureau had uncovered against Porter.

In November, the FBI provided the White House with additional information.

Sanders insisted Tuesday that senior West Wing officials had not learned about the allegations against Porter until they surfaced in The Daily Mail because the FBI 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.

Sanders said that the security office — which she repeatedly noted was staffed by “career officials,” who would not have been appointed by Trump — had not yet made a final determination on whether 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 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,” 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 Porter in July and saw that the FBI had interviewed Porter’s two former wives but not Porter himself. The office asked the FBI 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 FBI 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 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 Porter’s contacted McGahn and told him 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. McGahn, who knew Porter’s girlfriend, at that point suggested to Porter he should consider leaving the White House, the people said. But 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 Kelly, weighed in on Tuesday on Wray’s testimony. Scaramucci posted on Twitter that 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,” Scaramucci added. “Kelly must resign.”

Sanders said Trump maintained confidence in Kelly, who told The Wall Street Journal on Tuesday that he had no regrets about how Porter’s case was handled.

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.

Trump’s aides initially said they had no inkling of the accusations against 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 Porter’s former wives with a black eye she said he had given her — defending Porter against the allegations and insisting that he was not being dismissed.

Even after Kelly changed his stance, calling the allegations vile and orchestrating Porter’s swift departure, the president has stuck up for Porter publicly, telling reporters that the situation had been “tough” and “sad” for Porter. The president insisted that Porter had denied the accusations, and wished him a successful career. On Tuesday, asked by reporters if he had a message for victims of abuse, Trump declined to answer.

On Capitol Hill, lawmakers 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 Sen. Jeff Flake, R-Ariz. He said the scandal had exacerbated a generational divide plaguing the party.

Sen. Chuck Schumer, D-N.Y., said Trump, who dispatched Sanders 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 said Tuesday. “You know, to have a spokesperson get out and say something is not good enough.”