Donald Trump had considered firing FBI Director James Comey “since the day he was elected,” deputy press secretary Sarah Huckabee Sanders said Wednesday.

Sanders reasoned that Trump fired Comey now — and not when he took office in January — because he wanted to give Comey a chance. She said that “over the last several months [Trump had] lost confidence” in him.

“He wanted to give Comey a chance,” Sanders, who took over for Sean Spicer in the press briefing, said. “He feels he made the right decision.”

She said Comey’s “missteps and mistakes” were the reasons he was fired, and added that he “had essentially taken a stick of dynamite and thrown it into the Department of Justice” when he held a press conference last July to announce the FBI investigation into Hillary Clinton’s use a private email server while she was secretary of State.

“It’s been an erosion of confidence,” she said. “The Department of Justice lost confidence, bipartisan members of Congresss made it clear that they had lost confidence and rank and file members at the FBI had lost confidence in their director.”

Sarah Huckabee Sanders: There was an “erosion” of confidence in Comey due to many “missteps and mistakes” https://t.co/w8tyrX7PiK — CNN Politics (@CNNPolitics) May 10, 2017

Sanders said she found it “startling” that Democrats weren’t out celebrating Comey’s ouster.

“If Hillary Clinton had won the election, which thank God she didn’t, if she had, she would have fired Comey immediately, and the very Democrats criticizing the president today would be dancing in the streets celebrating.”

WH deputy press secretary @SHSanders45: “If Hillary Clinton had won… she would have fired Comey immediately.” https://t.co/xyeEL3uVxA — CNN (@CNN) May 10, 2017

Sanders said Comey’s firing would not affect the FBI’s investigation into Russian interference in the 2016 presidential election, including whether there were ties between the Trump campaign and the Russians.

“Any investigation happening Monday is still happening today,” she said. “We encourage them to complete this investigation. Nobody wants this to be finished and competed more than we do.”

Before Trump dismissed Comey for the way he handled the investigation into Hillary Clinton’s email server, he praised him for it. (RELATED: Trump Praises Comey For Emails)

“It took a lot of guts for Director Comey to make the move that he made in light of the kind of opposition he had with the trying to protect her from criminal prosecution,” Trump said at a rally before he won the presidency. “I really disagreed with him. I was not his fan.”

Sanders argued this was because Trump had a different role then.

“The president was wearing a different hat back then,” she said. “He was a candidate.”