Emails show FBI officials scrambling to correct the record after then-Director James Comey provided inaccurate testimony about a top aide to Hillary Clinton.

In Senate testimony on May 3, 2017, Comey said Huma Abedin made “a regular practice” of forwarding “hundreds and thousands” of emails from her boss to her husband and former Congressman Anthony Weiner, some of which were classified. Comey said Abedin did this so Weiner could print the emails out.

The FBI, which had seized Weiner's laptop as part of a criminal investigation into his sexting with a high school student, found Comey's assertion to be widely overstated, and on May 8 ProPublica reported that officials were working to correct the record.

In an email thread beginning at 6:34 a.m. on May 9, FBI officials frantically conversed about drafting a letter to Congress. The email thread, involving nearly a dozen officials, had the subject line, “Comey’s Testimony on Huma Abedin Forwarding Emails Was Inaccurate – ProPublica."

At 8:56 a.m., Comey’s chief of staff, Jim Rybicki, sent the group a draft letter which said, “Below is a draft that has been reviewed by the Director. Please let me know your thoughts.”

In an afternoon response, Greg Brower, the FBI assistant director for the Office of Congressional Affairs, asked his colleagues to "Please review" the latest version of the draft letter.

On May 9, the finalized letter was sent to the Senate Judiciary Committee, the FBI stated that only a "small number” of the approximately 49,000 “potentially relevant” emails found on Weiner’s laptop were forwarded by Abedin.

Hours later, Trump fired Comey while he was in Los Angeles.

The emails, released with several redactions, were obtained by conservative watchdog group Judicial Watch in response to a May 21 court order by U.S. District Judge Reggie Walton to the FBI to process 13,000 pages of records. In a press release, the group said the emails show the bureau worked to "muddle" Comey's message.

The FBI investigated Clinton's use of an unauthorized server, hosted in the basement of her home in Chappaqua, N.Y., during her time as secretary of state from 2009 to 2013. Comey publicly recommended in 2016 that no charges be brought against Clinton, who was then a candidate for president, but admonished Clinton and her colleagues for being "extremely careless" in handling classified information.

The State Department is now conducting a review related to the handling of classified information, and so far has found 30 security incidents.