WASHINGTON (AP) — Deputy Attorney General Rod Rosenstein is taking swipes at his critics as he prepares to leave the Justice Department, using one of his final speeches to defend his handling of the special counsel’s Russia investigation and condemn decisions made before he took the job.

Rosenstein, in an appearance Thursday night before a lawyers’ group, aimed pointed remarks at former FBI Director James Comey, lawmakers, political pundits and the media.

The No. 2 Justice Department official appointed special counsel Robert Mueller to investigate ties between President Donald Trump’s campaign and Russia — an inquiry that Trump repeatedly called “a witch hunt. Last week, Rosenstein backed Attorney General William Barr’s decision to clear Trump on obstruction even though Mueller refused to do so.

In his speech, Rosenstein tried to distance himself from some actions in the early days of the Russia investigation that he suggested he did not agree with. He appeared to take particular umbrage with the disclosures, both public and private, related to the counterintelligence investigation, including Comey’s public acknowledgement of its existence at a March 2017 congressional hearing.

“There is a story about firefighters who found a man on a burning bed,” Rosenstein said, according to his prepared remarks at the Armenian Bar Association’s Public Servants Dinner in New York. “When they asked how the fire started, he replied, ‘I don’t know. It was on fire when I lay down on it.’ I know the feeling.”

He noted that the FBI had disclosed classified material to lawmakers and their staff and observed how “someone” had selectively leaked details of the Russia investigation to the media. Rosenstein also appeared to frown on Comey’s public confirmation of the investigation and the fact that it might result in criminal charges — an announcement made with the Justice Department’s approval, though before Rosenstein was confirmed.

“Then the former FBI director alleged that the president pressured him to close the investigation, and the president denied that the conversation occurred,” Rosenstein said. “So that happened.”

Rosenstein also suggested that former President Barack Obama and his team could have done more to warn Americans about Russian election interference in 2016.

“The previous administration chose not to publicize the full story about Russian computer hackers and social media trolls, and how they relate to a broader strategy to undermine America,” Rosenstein said.

Rosenstein is expected to leave his position now that Mueller has submitted his report. The Senate Judiciary Committee held a confirmation hearing this month for Jeffrey Rosen, a longtime litigator and current deputy transportation secretary who has been nominated by Trump to succeed Rosenstein.

Rosenstein did pay tribute to Trump by quoting him on adherence to the rule of law. But Rosenstein also broke with the president in several notable ways. He said that “there is not Republican justice and Democrat justice,” contrasting himself with a president who referred to the Mueller team as being compromised of “angry Democrats” and who, according to Mueller’s report, has viewed the Justice Department as a tool for punishing political adversaries.

He also made clear that the Mueller investigation had exposed a sophisticated Russian operation to meddle in American politics, something Trump has been slow to acknowledge.

“There was overwhelming evidence that Russian operatives hacked American computers and defrauded American citizens, and that is only the tip of the iceberg of a comprehensive Russian strategy to influence elections, promote social discord, and undermine America, just like they do in many other countries,” Rosenstein said.

In his speech, Rosenstein lashed out at “mercenary critics” who “get paid to express passionate opinions” and who, he said, have attacked him without any information. He said politicians in Washington feel the “need to evaluate everything in terms of the immediate political impact.”

The news media wasn’t spared his criticism.

“A republic that endures is not governed by the news cycle,” he said. “Some of the nonsense that passes for breaking news today would not be worth the paper was printed on, if anybody bothered to print it. It quickly fades away. The principles are what abide.”