The Department of Justice released documents Monday outlining a slew of "security violations" and flagrantly "unprofessional conduct" by anti-Trump ex-FBI agent Peter Strzok — including his alleged practice of keeping sensitive FBI documents on his unsecured personal electronic devices, even as his wife gained access to his cellphone and discovered evidence that he was having an affair with former FBI attorney Lisa Page.

The DOJ was seeking to dismiss Strzok’s lawsuit claiming he was unfairly fired and deserves to be reinstated as chief of the counterespionage division at the FBI. In its filing, the DOJ included an August 2018 letter to Strzok from the DOJ's Office of Professional Responsibility (OPR), which said in part that Strzok had engaged in a "dereliction of supervisory responsibility" by failing to investigate the potentially classified Hillary Clinton emails that had turned up on an unsecured laptop belonging to Anthony Weiner as the 2016 election approached.

The situation became so dire, OPR said, that a case agent in New York told federal prosecutors there that he was "scared" and "paranoid" that "somebody was not acting appropriately" and that "somebody was trying to bury this."

FBI BLAMES SYSTEM-WIDE SOFTWARE FAILURE FOR MISSING STRZOK TEXTS -- PHONE FROM MUELLER DAYS TOTALLY WIPED

The New York prosecutors then immediately relayed their concerns to the DOJ, effectively going over Strzok's head — and leading, eventually, to then-FBI Director James Comey's fateful announcement just prior to Election Day that emails possibly related to the Clinton probe had been located on Weiner's laptop.

Additionally, DOJ and OPR noted that although Strzok claimed to have "double deleted" sensitive FBI materials from his personal devices, his wife nonetheless apparently found evidence of his affair on his cellphone — including photographs and a hotel reservation "ostensibly" used for a "romantic encounter." Strzok didn't consent to turning over the devices for review, according to OPR, even as he acknowledged using Apple's iMessage service for some FBI work.

"[My wife] has my phone. Read an angry note I wrote but didn't send you. That is her calling from my phone. She says she wants to talk to [you]. Said we were close friends nothing more," one of Strzok's text to Page read, according to the filing.

"Your wife left me a vm [voicemail]. Am I supposed to respond? She thinks we're having an affair. Should I call and correct her understanding? Leave this to you to address?" Page responded.

Strzok then wrote, "I don't know. I said we were [] close friends and nothing more. She knows I sent you flowers, I said you were having a tough week."

Strzok's wife allegedly threatened to send Page's husband some of the photographs from Strzok's phone.

The messages were first flagged by Twitter user Techno Fog.

OPR and the DOJ also included a slew of Strzok and Page's anti-Trump text messages, which Strzok sent as he was overseeing the 2016 Clinton email investigation.

An after-hours email sent to Aitan Goelman, a partner with Zuckerman Spaeder LLP and one of Strzok’s lawyers, was not immediately returned.

WATCH REP. GOHMERT UNLOAD ON ‘SMIRKING’ STRZOK: ‘HOW MANY TIMES DID YOU LOOK SO INNOCENT INTO YOUR WIFE’S EYES AND LIE TO HER?’

Strzok, a veteran counterintelligence agent who led FBI investigations into Hillary Clinton’s use of a private email server and ties between the Trump campaign and Russia, was removed from Special Counsel Robert Mueller’s team after his anti-Trump texts with Page came to light. He was fired from the FBI last August.

The motion claimed that Strzok cannot succeed on any of his claims. The document said his key role within the agency on some of its highest-profile investigations “imposed on him a higher burden of caution with respect to his speech.”

Strzok, who joined the FBI in 1998 and rose to deputy assistant director of the agency’s counterintelligence division, exchanged over 40,000 text messages on government-issued phones from August 2015 through May 2018, the motion said. One of the messages called then-candidate Trump a “disaster” and suggested that”[w]e’ll stop” him.

Republicans interpreted the text as Strzok saying that he would work to prevent Trump from being elected, but his lawsuit says the message was actually meant to reassure Page, with whom he was having an affair, that the American people would not support a Trump candidacy.

"She knows I sent you flowers, I said you were having a tough week." — Text from Peter Strzok to Lisa Page, after Strzok's wife uncovered evidence of apparent affair

Trump seized on these messages and used Strzok as a favorite target during the Russia investigation. Trump identified these messages as proof that the investigators were biased in their investigation.

“It is because of those text messages, and the paramount importance of preserving the FBI’s ability to function as a trusted, nonpartisan institution, that Plaintiff was removed from his position, and not because of any alleged disagreement with Plaintiff's viewpoints on political issues or Tweets from the President,” the motion claimed.

The motion—which identified Attorney General William Barr as the defendant-- claimed that Strzok’s allegation that his due process rights were infringed upon would be soundly rejected due to his position on FBI’s Senior Executive Service at the time of his firing. The department also claimed that he was “given ample notice and opportunity to be heard."

Goelman said at the time that Strzok filed the lawsuit: "While many in law enforcement have faced attacks by this president, Pete Strzok has been a constant target for two years. It’s indisputable that his termination was a result of President Trump’s unrelenting retaliatory campaign of false information, attacks and direct appeals to top officials."

CLICK HERE FOR THE ALL-NEW FOXBUSINESS.COM

The lawsuit also says the Justice Department set out to smear Strzok's reputation and humiliate him when it disclosed nearly 400 text messages he had sent or received.

Fox News' Brooke Singman, Andrew O'Reilly and the Associated Press contributed to this report.