President Donald Trump's former chief of staff, John Kelly, issued a broad rebuke of the president on Wednesday.

Kelly broke with Trump over the president's firing of Lt. Col. Alexander Vindman, the White House's former Ukraine expert who testified against the president as part of his impeachment inquiry after being subpoenaed by Congress.

Kelly described what Vindman heard Trump tell Ukranian President Volodymyr Zelensky during their July 25 phone call last year as "an illegal order."

"He did exactly what we teach them to do from cradle to grave," Kelly said of Vindman, according to The Atlantic. "He went and told his boss what he just heard."

"We teach them: Don't follow an illegal order," Kelly said. "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."

Visit Business Insider's homepage for more stories.

President Donald Trump's former chief of staff John Kelly, who served at the highest levels of the White House for 18 months, issued a broad rebuke of the president during remarks on Wednesday night.

Perhaps most notably, Kelly criticized Trump's firing of Lt. Col. Alexander Vindman, an impeachment witness and former National Security Council aide, and defended Vindman's efforts to report Trump's pressure campaign in Ukraine up through the chain of command.

"He did exactly what we teach them to do from cradle to grave," Kelly, a retired general, told an audience at Drew University in Morristown, N.J. of Vindman, according to The Atlantic. "He went and told his boss what he just heard."

Kelly described what Vindman heard Trump tell Ukranian President Volodymyr Zelensky during their July 25 phone call last year as "an illegal order."

"We teach them: Don't follow an illegal order," Kelly said. "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."

Vindman directly listened in on the July 25 call, during which Trump repeatedly pressured Zelensky to launch politically motivated investigations targeting former Vice President Joe Biden, a 2020 Democratic presidential frontrunner, and the Democratic Party as a whole.

Trump made those demands while withholding vital military aid and a White House meeting that Zelensky desperately wanted and still hasn't gotten.

Vindman testified that he was "concerned" by what he heard and that he immediately reported it to John Eisenberg, the NSC's chief lawyer.

"It was inappropriate, it was improper for the president to request — to demand — an investigation into a political opponent, especially a foreign power where there's at best dubious belief that this would be a completely impartial investigation," Vindman said.

Trump fired Vindman — as well as his twin brother, Yevgeny, who served on the NSC as an ethics lawyer and had no connection to the impeachment inquiry — last week.

Since then, the president has publicly criticized Vindman and suggested the military, where he is being reassigned, should discipline him.

"It turned out that what he reported was very different," Trump said this week. "And also when you look at the person he reports to, said horrible things, avoided the chain of command, leaked, did a lot of bad things. And so we sent him on his way to a much different location, and the military can handle him anyway they want."

The president also responded to Kelly's remarks on Thursday, tweeting, "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. 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 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!"