(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.

Read More