Shortly before the expected release of a damning memo claiming wrongdoing by top FBI officials, President Trump slammed the bureau and the Justice Department on Friday for having “politicized” their investigations and favoring Democrats.

“The top Leadership and Investigators of the FBI and the Justice Department have politicized the sacred investigative process in favor of Democrats and against Republicans – something which would have been unthinkable just a short time ago,” Trump tweeted.

“Rank & File are great people!” he added.

The White House has said the president will allow the publication of the classified memo prepared by Republicans accusing the FBI of abusive surveillance tactics against one of Trump’s ex-advisers in connection with the Russia probe.

The memo, prepared by GOP members on the House Intelligence Committee, is said to allege FBI misconduct in the early stages of its investigation of potential ties between Russia and Trump’s 2016 campaign.

It’s unclear whether Congress will release the memo Friday, though House Intelligence Committee Chairman Devin Nunes and other Republicans have been eager to make it public despite objections from the feds.

In a statement released Wednesday, the FBI expressed “grave concerns about material omissions of fact that fundamentally impact the memo’s accuracy.”

Trump’s condemnation of top FBI and Justice officials comes as senior White House officials are worried that FBI Director Christopher Wray may quit if the president releases the memo.

The president also tweeted a quote from Judicial Watch president Tom Fitton, who described how Justice officials used their authority to spy on his campaign.

“‘You had Hillary Clinton and the Democratic Party try to hide the fact that they gave money to GPS Fusion to create a Dossier which was used by their allies in the Obama Administration to convince a Court misleadingly, by all accounts, to spy on the Trump Team.’ Tom Fitton, JW,” Trump wrote.