President Trump on Thursday hit back at his former chief of staff, John Kelly, after he defended a former National Security Council official who was ousted after testifying against the president in the impeachment inquiry -- saying Kelly “can’t keep his mouth shut.”

“When I terminated John Kelly, which I couldn’t do fast enough, he knew full well that he was way over his head. Being Chief of Staff just wasn’t for him,” Trump tweeted Thursday.

IMPEACHMENT WITNESS VINDMAN FIRED, ESCORTED OUT OF WHITE HOUSE AFTER TRUMP ACQUITTAL

“He came in with a bang, went out with a whimper, but like so many X’s, he misses the action & just can’t keep his mouth shut, which he actually has a military and legal obligation to do,” Trump continued.

He added: “His incredible wife, Karen, who I have a lot of respect for, once pulled me aside & said strongly that ‘John respects you greatly, When we are no longer here, he will only speak well of you.’ Wrong!”

The president’s comments come after Kelly, a retired four-star Marine Corps general, defended Alexander Vindman at an event at Drew University on Wednesday night.

“He did exactly what we teach them to do from cradle to grave,” Kelly told the audience according to The Atlantic. “He went and told his boss what he just heard.”

Vindman had reported concerns about Trump’s July 25 phone call with Ukrainian President Volodymyr Zelensky to his higher-ups at the NSC after the president pressured Kiev to launch investigations into former Vice President Joe Biden and his son Hunter Biden’s business dealings in Ukraine.

The president’s request came after millions of dollars in U.S. military aid to Ukraine had been frozen, which Democrats argue shows a “quid pro quo” arrangement.

“Through the Obama administration up until that phone call, the policy of the U.S. was militarily to support Ukraine in their defensive fight against … the Russians,” Kelly reportedly said. “And so, when the president said that continued support would be based on X, that essentially changed. And that’s what that guy [Vindman] was most interested in.”

Kelly reportedly told the audience at the event that Trump’s request was “an illegal order.”

TRUMP OUSTS GORDON SONDLAND DAYS AFTER SENATE ACQUITTAL

“We teach them, ‘Don’t follow an illegal order. And if you’re ever given one, you’ll raise it to whoever gives it to you that this is an illegal order, and then tell your boss,'” Kelly explained.

Vindman was removed from his post at the NSC and escorted off the White House grounds last week. Vindman, a lieutenant colonel, was on detail to the NSC from the Department of Defense. His removal came just days after the president was acquitted on both charges of abuse of power and obstruction of Congress in connection to his pressure campaign on Ukraine to investigate Democrats.

Vindman testified against the president in the House’s impeachment inquiry last year.

Also last week, U.S. Ambassador to the European Union Gordon Sondland, who also testified about Trump’s Ukraine dealings during the impeachment hearings, said he had been recalled from his post as well.

A senior administration official also told Fox News that Vindman’s twin brother Lt. Col. Yevgeny Vindman has also left the National Security Council. Yevgeny Vindman was assigned to the office that vetted publications like former national security adviser John Bolton’s book – though he has said he was not involved in the vetting of the Bolton manuscript.

Kelly left his post as White House chief of staff at the end of 2018, after a 17-month-long tenure in the Trump administration. Kelly first served as Homeland Security secretary.

Fox News' John Roberts contributed to this report.