FBI Director Christopher Wray said the bureau completed its investigation of White House staff secretary Rob Porter in July, nearly seven months before Porter was forced to resign over allegations of domestic violence from two ex-wives.

That appears to be at odds with the account from White House, which said the Porter investigation was "not complete" at the time of last week's ouster.

White House press secretary Sarah Huckabee Sanders later clarified that the FBI investigation is only the first step in the lengthy background check process.

"The FBI portion was closed," Sanders told reporters Tuesday. "The White House personnel security office, who is the one that makes the recommendation for adjudication, had not finished their process and therefore not made a recommendation to the White House."

Wray testified about the timeline before the Senate intelligence committee on Tuesday morning. His account underscored questions about why the Trump administration allowed Porter to remain in a sensitive job for so long, once information about the allegations against him was available, and how forthcoming the administration has been regarding what it knew about Porter.

Wray declined to say what the FBI uncovered in its background check. But Porter's ex-wives have said they told investigators about the alleged abuse early in 2017. One of the women, Colbie Holderness, also produced a photograph showing her with a black eye.

Porter has denied the allegations.

The FBI moved fairly quickly to share what it learned with the White House.

"What I can tell you is that the FBI submitted a partial report on the investigation in question in March and then a completed background investigation in late July," Wray said in response to questions from Sen. Ron Wyden, D-Ore.

The White House was undergoing a staff shake-up around that time. President Trump announced via Twitter on July 28 that John Kelly would replace Reince Priebus as White House chief of staff.

Wray said that soon after filing its completed background check on Porter, the FBI was asked for additional information.

"We received a request for follow-up inquiry. And we did the follow-up and provided that information in November," Wray told the Senate committee. He said the FBI had closed its case file on Porter in January, although the bureau received additional information in early February, which it passed along to the White House.

Sanders said the request for follow-up information came from the personnel security office.

"The FBI's July report required significant additional investigatory fieldwork before [the] personnel security office could begin to evaluate the information for adjudication," she said.

Sanders could not say definitively whether the personnel security office, which is staffed by career officials, had shared the FBI's findings from July or November with any political appointees in the West Wing.

"I'm not aware of any communication," Sanders said, adding that she had spoken about that with both Kelly and White House counsel Don McGahn. "I have, and this is the information that was given to me by those individuals."

White House officials continued to defend Porter as late as last week, even after his ex-wives' accusations were made public by the Daily Mail and the Intercept.

Kelly initially issued a statement calling Porter a man of "true integrity," although he later said he was "shocked" by the allegations, adding, "There is no place for domestic violence in our society."

On Monday, Sanders insisted the White House had acted swiftly once the allegations against Porter were known.

"We learned the extent of the situation involving Rob Porter last Tuesday evening, and within 24 hours, his resignation had been accepted and announced," Sanders said.

In his Senate testimony, Wray noted that while the FBI conducts background check investigations, it does not determine who gets a security clearance. That is decided by the personnel security office.

Porter never received a permanent security clearance and was operating on an interim clearance until his departure.