On Tuesday, James B Comey was fired as the FBI Director by President Donald Trump, after officials in the Department of Justice recommended the firing.

Officials said Comey had treated Hillary Clinton unfairly and by doing so had damaged the Justice Department and FBI credibility.

The surprising development arrives as Comey was heading up an investigation of counterintelligence to determine if associates of Trump might have been coordinating with Russia to interfere with the presidential election in November of last year in the U.S.

It was not clear how the ouster of Comey would affect the probe of Russia, but Democrats expressed concern his ouster would derail that investigation.

U.S. Attorney General Jeff Sessions said that Andrew McCabe, who was Comey’s deputy director, would act as director of the FBI until a replacement for Comey was found.

While campaigning for the presidency, Trump criticized Comey as well as McCabe for the roles they played in the probe of Clinton while at other times praising Comey for the “guts” he showed.

The attorney general and deputy attorney general’s recommendation was accepted by the president regarding dismissing the FBI director, said Sean Spicer the White House press secretary. He added that the firing took effect immediately.

Wednesday morning Trump lashed back at the Democrats who expressed outrage at the firing of Comey.

Trump tweeted that the Democrats said worse things about Comey, including he should be fired, but now play sad.

In another tweet, Trump posted that Comey lost the confidence of nearly everyone in Washington, Democrat and Republican alike.

Trump defended his decision by saying that Comey was to be replaced by someone who will do much better and who will restore the prestige and spirit of the Bureau.

Comey was attending a recruiting trip on Tuesday in Los Angeles when he received word of his firing.

Officials said he had been fired due to senior officials in the Justice Department concluding he violated procedures and principles of the DOJ in 2016 when he publicly discussed the Hillary Clinton investigation over her using a private email server while serving as secretary of state under former President Barrack Obama.

Democrats long argued that the decisions by Comey in the days prior to the presidential election hurt the standing of Clinton with voters and had affected the election outcome, but Trump and advisors said Comey was too easy on Clinton and her aides.

Get Analysts' Upgrades and Downgrades Daily - Enter your email address below to receive a concise daily summary of analysts' upgrades, downgrades and new coverage with MarketBeat.com's FREE daily email newsletter.