Attorney General Jeff Sessions speaks last month in Washington. (Mandel Ngan/AFP/Getty Images)

The Justice Department's inspector general is investigating why the FBI did not retain text messages for five months, including those exchanged by two senior officials involved in the probes of Hillary Clinton and Donald Trump.

Attorney General Jeff Sessions said late Monday that he has spoken to Inspector General Michael E. Horowitz about the missing text messages and that "a review is already underway to ascertain what occurred" and determine whether the missing text messages can be recovered.

"We will leave no stone unturned to confirm with certainty why these text messages are not now available to be produced and will use every technology available to determine whether the missing messages are recoverable from another source," Sessions said in a statement.

Horowitz could not be reached for comment.

Sessions's statement came after Sen. Ron Johnson (R-Wis.), chairman of the Senate Homeland Security and Governmental Affairs Committee, wrote a letter this past weekend to FBI Director Christopher A. Wray asking the FBI to explain in more detail why it did not preserve text messages between senior FBI agent Peter Strzok and bureau lawyer Lisa Page between "approximately December 14, 2016 and May 17, 2017."

Strzok was removed from the Trump probe last summer after internal investigators discovered he and Page, who were romantically involved, exchanged texts that were anti-Trump and pro-Clinton during FBI investigations of both candidates, who were running for president.

In December, the Justice Department provided Congress with 375 text messages dated between Aug. 16, 2015, and Dec. 1, 2016, including those between Strzok and Page, according to a letter that Assistant Attorney General Stephen E. Boyd sent to Congress on Friday.

The Homeland Security and Governmental Affairs Committee received 384 pages of new Strzok-Page texts Friday.

But Boyd wrote that the FBI's "technical system for retaining text messages" sent and received on FBI mobile devices failed to preserve text messages between Strzok and Page from Dec. 14, 2016, to approximately May 17, 2017. That was the date that Deputy Attorney General Rod J. Rosenstein tapped Robert S. Mueller III as special counsel to investigate possible connections between the Trump campaign and Russia.

"The FBI has informed us that many FBI-provided Samsung 5 mobile devices did not capture or store text messages due to misconfiguration issues related to rollouts, provisioning and software upgrades that conflicted with the FBI's collection capabilities," Boyd wrote.

Sessions said Monday that if the missing text messages are recovered, the Justice Department will notify the committees immediately.

"Six congressional committees made a request to the Department of Justice for FBI text messages between two FBI employees from July 1, 2015 to July 28, 2017, which the Department agreed to produce as quickly as possible," Sessions said. "After reviewing the voluminous records on the FBI's servers, which included over 50,000 texts, the Inspector General discovered the FBI's system failed to retain text messages for approximately 5 months."

Sessions said that if any wrongdoing was involved in causing the gap, "appropriate legal disciplinary action measures will be taken."