Former Deputy Attorney General Rod Rosenstein said he made the call to release to the media hundreds of text messages between two high-ranking FBI employees after they criticized then-candidate Donald Trump during the 2016 presidential race, according to new court filings the Justice Department released late Friday night.

In the messages, FBI agent Peter Strzok and FBI attorney Lisa Page insulted Trump as well as Sen. Bernie Sanders (I-Vt.), expressing a preference for Hillary Clinton in the election. The messages, which were exchanged on government cellphones, also revealed that the two were engaged in an extramarital affair, which has made them the subject of public harassment as well as ridicule from the president.

During former special counsel Robert Mueller's investigation, which looked into whether the Trump campaign accepted help from the Russian government in 2016, President Trump and his Republican allies in the House used the messages to suggest that the FBI was a biased agency that was against his campaign from the beginning. 

Strzok and Page filed separate lawsuits against the Department of Justice (DOJ) last year, alleging that the release of their text messages violated the Privacy Act, which safeguards information federal agencies hold about private individuals.

The FBI fired Strzok in 2018, which he is also contesting in the suit, and Page later resigned from the agency.

Until Friday, it was unclear who authorized the December 2017 release of the more than 300 messages the two exchanged.

In the court filing Friday, which presents the DOJ’s defense against Strzok’s lawsuit, Rosenstein said he decided to release the messages because they would inevitably become public after his testimony before the House Judiciary Committee during the Mueller investigation. He said he also wanted to ensure they weren’t “cherry-picked” by members of the committee. Read more at The Hill