Former Deputy Attorney General Rod Rosenstein was behind the leak of text messages between the FBI ‘s Peter Strzok and Lisa Page to the press.

A court filing by the Department of Justice late Friday revealed the admission in a five-page statement by Rosenstein on the text messages between the FBI agent and lawyer back in 2016 as they were both working on investigations, Politico reported.

Rosenstein, who stepped down from his position last year, apparently released the messages as a way to protect the FBI employees who criticized then-candidate Donald Trump during the 2016 presidential campaign. Before Friday’s disclosure, it had not been known who had authorized the release of about 375 messages to the press in December 2017.

“With the express understanding that it would not violate the Privacy Act and that the text messages would become public by the next day in any event, I authorized [Justice’s Office of Public Affairs] to disclose to the news media the text messages that were being disclosed to Congressional committees,” Rosenstein wrote in his statement.

The Justice Department is seeking to dismiss a lawsuit by Strzok that challenges his firing and seeks damages for invasion of privacy. Page filed a separate lawsuit against the DOJ last year, and both have claimed that the leaking of their text messages violated the Privacy Act.

“The Department’s Office of Public Affairs … recommended providing the text messages to the media because otherwise, some congressional members and staff were expected to release them intermittently before, during and after the hearing, exacerbating the adverse publicity for Mr. Strzok, Ms. Page and the Department,” Rosenstein wrote.

“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,” he added.

According to Politico:

Rosenstein, who stepped down from his position as Justice’s No. 2 official last May, said in his new submission that his aides initially suggested he might want to delay sending the texts to Congress until after his House testimony. But the veteran prosecutor said he concluded it would be “inappropriate” to hold them back, even briefly, for that reason. Rosenstein also said he decided to give the messages to the media before his testimony because of concerns that they would be cherrypicked in a manner that could be detrimental to the Justice Department, as well as Strzok and Page.

The former FBI employees, who were engaged in an extramarital affair at the time of the text messages exchanged on government cellphones, leveled disparaging remarks about Trump and even referred to an “insurance policy” to prevent his winning the election.

Strzok was removed from his role in the Russia investigation by then-special counsel Robert Mueller in 2017. He was fired from the agency in 2018. Page resigned from the FBI in May 2018.