A former top FBI official assigned to special counsel Robert Mueller’s Russia probe was taken off that job this past summer after his bosses discovered he and another member of Mueller’s team had exchanged politically charged texts. (The Washington Post)

The FBI failed to save text messages sent from thousands of cellphones — apparently because of the same technical glitch that affected the retention of messages from two senior bureau officials who investigated both Hillary Clinton and Donald Trump, a Justice Department official said.

The missing messages from senior FBI lawyer Lisa Page and senior counterintelligence agent Peter Strzok have sparked a political firestorm in recent days, as GOP lawmakers and the president have questioned how it could be that the bureau did not keep their potentially unflattering and revealing exchanges.

That the glitch that affected their messages also impacted other FBI phones might cast doubt on the theory that the two officials’ texts were specifically and intentionally withheld. But the revelation also presents the FBI as inept at retaining records that could be important to internal and other investigations. The development was first reported by Fox News.

Page and Strzok have become important figures in an internal investigation after the Justice Department inspector general found the pair exchanged notes expressing dislike of Trump and fear he might win. Their missing texts are from a five-month period ending the day special counsel Robert S. Mueller III was appointed to investigate possible coordination between the Kremlin and Trump’s campaign.

Page and Strzok were both once a part of Mueller’s team, though Page ultimately left and Strzok was removed in July when the anti-Trump texts were discovered.

“That’s a lot of missing texts, and as I said yesterday, that’s prime time,” Trump said Wednesday. “So, you do sort of look at that and say, ‘What’s going on?’ ”

The Justice Department had previously indicated to lawmakers that Page’s and Strzok’s texts were missing because “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,” according to a letter sent by Sen. Ron Johnson (R-Wis.) earlier this week.

Attorney General Jeff Sessions said in a statement this week that he had spoken to the inspector general and “a review is already underway to ascertain what occurred and to determine if these records can be recovered in any other way.”

“If any wrongdoing were to be found to have caused this gap, appropriate legal disciplinary action measures will be taken,” Sessions said. “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.”

An FBI spokeswoman declined to comment.

Sessions said that in trying to prepare Page’s and Strzok’s texts to turn over to Congress, the department reviewed more than 50,000 texts on the FBI’s servers. A Justice Department official said that represented messages between Page and Strzok. It is not clear how many of those are missing.

The department has turned over hundreds of messages to lawmakers, some of which have been released publicly. Johnson, for example, revealed one message in recent days indicating Strzok at first hesitated to participate in the Russia probe because “of my gut sense and concern there’s no big there there.”

Earlier, messages had been revealed publicly showing Page call Trump a “loathsome human” and remarking “This man can not be president” after Trump had made a comment about the size of his hands.