CNN  — 

Former Deputy Attorney General Rod Rosenstein approved the release of top FBI official Peter Strzok’s text messages with then-FBI attorney Lisa Page to protect the FBI and because Congress deserved to see them, he wrote in a court filing late Friday night.

The admission, the Justice Department argued, shows that the two FBI officials, who had texted about their dislike of Donald Trump, weren’t illegally retaliated against by the Department for criticizing the President.

“If I had believed that the disclosure was prohibited by the Privacy Act, I would have ordered Department employees not to make the disclosure,” Rosenstein wrote in an affidavit. “The disclosure obviously would adversely affect public confidence in the FBI, but providing the most egregious messages in one package would avoid the additional harm of prolonged selective disclosures and minimize the appearance of the Department concealing information that was embarrassing to the FBI.”

The court filing came as part of the Department of Justice’s defense, after Strzok, formerly the FBI’s deputy assistant director, sued the Justice Department and FBI for wrongful termination and for privacy and due process violations.

Both Strzok and Page have heavily criticized the Department’s release of the text messages, which the Trump administration first showed to members of the media in December 2017.

Separately from Strzok’s lawsuit, Page sued the DOJ and FBI for invading her privacy by releasing the texts to the media. Both lawsuits are in their early stages in federal court in Washington.

On Saturday, Page tweeted, “All I can say is this: I very much look forward to Rod’s deposition,” in response to the Rosenstein affidavit.

Rosenstein said he and special counsel Robert Mueller learned in the summer of 2017 that Strzok and Page sent partisan texts that appeared to violate department policy.

Rosenstein allowed the Justice Department’s legislative affairs office to hand them to Congress, and the public affairs’ department sought to release them to the media, he wrote.

Rosenstein wrote in the affidavit that he inquired whether the texts were private after Congress had asked to see them. He said he “understood” they weren’t because they were sent on government phones and “were so inappropriate and intertwined with their FBI work that they raised concerns about political bias influencing official duties.”

“There was a legitimate congressional oversight interest,” he added in the sworn court filing.

The DOJ also noted that it had shared the texts in late November, just before the public release, “to defense counsel as potentially exculpatory information” in the special counsel’s case against former national security adviser Michael Flynn, who pleaded guilty to lying to Strzok and another agent in a White House interview.

For months, Trump has blamed Strzok and Page for being politically motivated against him during their work on major investigations into Hillary Clinton and into the Trump campaign in 2016. He has regularly publicly attacked them.

An independent Justice Department investigation found the text messages “cast a cloud” over the FBI’s work, according to a report on the investigation of the former Secretary of State’s use of a private email server. But the Justice inspector general also found the opening of the investigation into Trump’s 2016 campaign was in line with departmental policy and not influenced by political animus.

Rosenstein left his position as No. 2 at the Justice Department this spring. He is now a lawyer in private practice in Washington.