Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WASHINGTON — FBI Director Chris Wray on Tuesday contradicted the White House's account of former staff secretary Rob Porter’s background investigation, revealing the bureau had finished its report long before Porter was fired over allegations of domestic abuse.

Wray told the Senate intelligence committee that the FBI had completed a partial report on Porter in March, finished its full report in late July, responded to a White House request for follow-up information in November, and closed the file in January.

"We administratively closed the file in January, and then earlier this month we received some additional information and we passed that on as well," Wray said, refusing to disclose the conversations between the White House and the FBI on Porter.

That timeline is at odds with the narrative the White House laid out last week after Porter's two ex-wives publicly accused him of verbal and physical abuse.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

White House Press Secretary Sarah Huckabee Sanders laid the blame Tuesday at the feet of the White House "personnel security office," saying it received information from the FBI about Porter last year but hadn't yet made a final recommendation to the White House on his security clearance. Asked if the office had engaged with the White House about the allegations against Porter, Sanders said "not that I'm aware of," but couldn't say with "100 percent certainty."

President Donald Trump himself ignored press questions on Porter during a meeting Tuesday with lawmakers on trade.

Deputy White House Press Secretary Raj Shah told reporters on Thursday, Porter's last day in the White House, that Porter's background investigation by the FBI was ongoing. White House Press Secretary Sarah Huckabee Sanders then told reporters Monday, "The White House had not received any specific papers regarding the completion of that background check."

NBC News has reported that White House Chief of Staff John Kelly knew in November what Porter's ex-wives had told the FBI.

While the FBI investigates applicants for security clearances, the president has the power to grant security clearance to anyone at his discretion. Those decisions are often made with the guidance of the chief of staff and chief legal counsel.

"What happened once the FBI sent its findings to the White House is the real question," said Mary Kuntz, a lawyer who defends clients with negative findings in background investigations.

Kuntz also said Porter would have had a chance to defend himself before the White House was made aware of the allegations.

Until an applicant is cleared through a full background investigation, they may continue to receive classified information on an interim clearance.

As many as 30 to 40 White House officials are still operating on interim security clearances more than one year into the administration, including Trump's son-in-law and senior adviser, Jared Kushner, NBC News has learned. The process can take a year to complete, but is usually expedited for people working in close proximity to the president.

Background investigations are critical because allegations of illegal or illicit activity, such as domestic abuse, can be used by adversaries to blackmail government officials in exchange for classified information.