Former White House chief of staff John F. Kelly laid bare an array of misgivings Wednesday night about President Trump’s policies and actions, including his ouster of Lt. Col. Alexander Vindman, the former National Security Council aide and impeachment witness.

Vindman, who raised concerns about a July phone call in which Trump pressed Ukraine's leader for investigations that could benefit him politically, “did exactly what we teach them to do,” Kelly, a retired Marine Corps general, told an audience at the Drew University Forum lecture series in Morristown, N.J.

Over the course of 75 minutes of remarks and questions and answers, Kelly, who left the White House early last year, also defended the news media, questioned Trump’s handling of North Korea, criticized Trump for intervening in a military justice case and took issue with his descriptions of immigrants, according to accounts in the Atlantic and local news media that were confirmed by a person with knowledge of the event.

Trump took aim at Kelly on Twitter on Thursday morning, saying Kelly “misses the action & just 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,” the president tweeted.

Trump also claimed that Kelly’s “incredible” wife had once told him that Kelly respected him and would only speak well of him in the future. “Wrong!” Trump said.

Kelly declined to comment on the tweets.

The president and Kushner grew disenchanted with Kelly after he tried to restrain some of the president’s impulses and put limitations on what members of the president’s family could do in the White House.

Kelly has criticized Trump pointedly and repeatedly in private for months but has only said negative things publicly at paid speaking engagements. He has not done a television interview. When Kelly left the White House, he promised Trump he would not write a book while the president was still in office, and Trump signaled in return that he would not attack Kelly.

Kelly has described Trump as amoral and a deeply flawed man in private, saying he only obsesses about his news coverage and thinks very little about what matters to the United States when making decisions. He has told associates that Trump is naïve when it comes to foreign policy because he only cares about what foreign leaders think of him and what makes him look strong in the moment, people who have heard his comments say.

Kelly was not immediately available for comment Thursday.

Vindman, an expert on Ukraine policy, was escorted out of the White House complex last week following Trump’s acquittal in a Senate impeachment trial, which focused on Trump’s attempts to pressure Ukraine to investigate former vice president Joe Biden at a time when U.S. military aid was being withheld.

Vindman, who listened in to Trump’s July 25 call with Ukrainian President Volodymyr Zelensky, was right to having notified his superiors after hearing something “questionable,” Kelly told an audience of about 300 at the Mayo Performing Arts Center in Morristown.

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

Kelly said that for Vindman, it amounted to hearing “an illegal order” when Trump told Zelensky he wanted to see an investigation of Biden and his son Hunter Biden, who had sat on the board of a Ukrainian energy company.

“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.”

During the event, Kelly also took issue with Trump’s repeated characterizations of the media as “the enemy of the people.”

“The media, in my view, and I feel very strongly about this, is not the enemy of the people,” he said, according to the Morristown Daily Record. “We need a free media. That said, you have to be careful about what you are watching and reading, because the media has taken sides. So if you only watch Fox News, because it’s reinforcing what you believe, you are not an informed citizen.”

Kelly also questioned the utility of Trump’s two summits with North Korean leader Kim Jong Un in a bid to get the isolated nation to give up its nuclear arms.

“He will never give his nuclear weapons up,” Kelly said of Kim. “President Trump tried — that’s one way to put it. But it didn’t work. I’m an optimist most of the time, but I’m also a realist, and I never did think Kim would do anything other than play us for a while, and he did that fairly effectively.”

Responding to another audience question, Kelly took issue with Trump’s decision to roll back disciplinary action against Chief Petty Officer Edward Gallagher, the Navy SEAL who was convicted of discrediting the armed forces by posing with the corpse of an Iraqi teenager.

“He was not a guy who represents our military in any way, shape or form,” Kelly said, according to MorristownGreen.com. “The military legal justice system worked; he was found guilty of certain things. He should have been ashamed of himself, and he should have been sent home.”

“So the idea that the commander in chief intervened there, in my opinion, was exactly the wrong thing to do,” Kelly said, generating applause from the crowd.

Kelly, who served as secretary of homeland security until July 2017, defended the Trump administration's efforts to reduce border crossings.

But he said most migrants are looking for jobs and a better life in the United States, and he took issue with how Trump characterized them in his presidential announcement speech in 2015 and on subsequent occasions.

“In fact, they’re overwhelmingly good people,” Kelly said, according to the Atlantic’s account. “They’re not all rapists, and they’re not all murderers. And it’s wrong to characterize them that way. I disagreed with the president a number of times.”

Correction: A previous version of this article inaccurately described the case of retired Navy SEAL Eddie Gallagher. President Trump rolled back disciplinary action against him but did not issue a pardon. Also, Gallagher was not convicted of a war crime related to the killing of an Iraqi teenager; he was convicted only of posing with the corpse.