John Kelly, then White House chief of staff, looked down at his desk with a grimace one night in January 2018 as Donald Trump stood in the doorway of his office. The retired Marine Corps general said nothing, but his face suggested discomfort.

Mr Kelly had invited a group of reporters into his West Wing office to discuss a coming White House immigration reform plan for a semi-formal chat. Then, the door swung opened and the president leaned inside. Kelly smiled, then put one hand on his desk and looked down. Such awkward and slightly tense moments were common during his run as Trump's right-hand man.

The military man left the White House later that year after several dust ups with his boss, merely the latest Cabinet or senior White House official to do so after falling out of favour with Mr Trump. Kelly has dropped a wry and critical comment about his former boss since returning to civilian life, but mostly has kept his opinions and insider tales to himself. That changed on Wednesday night, went Mr Kelly pulled back the curtain, revealing a naive and impulsive president who he says, in so many words, just doesn't get it.

Here are three takeaways from Mr Kelly's appearance at Drew University in Morristown, New Jersey.

'Illegal order'

The retired Marine left no doubt about whether he believes Mr Trump might have abused his power or even committed a criminal act when he asked Ukraine's president to "do us a favour though" by investigating top US Democrats like the Bidens immediately after the pair had discussed a $391m military aid package Kiev wanted in its standoff with Russia.

Mr Kelly defended Army Lt. Col. Alexander Vindman, who testified in the House's impeachment inquiry that he was alarmed by Mr Trump's words on the call, and worried the president had gone too far. Mr Kelly said Mr Vindman did the right thing by speaking up because military personnel are trained to resist "an illegal order."

"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,'" he said.

With that one comment, the veteran of Washington policy-making said, Mr Trump altered years of cross-administration policy towards a key Eastern European ally.

"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," Mr Kelly 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."

But Mr Trump and some Republican lawmakers say he "did nothing wrong," with the president continuing to describe that 25 July phone call as "perfect." Kelly did not speak out while the Senate was considering two House-passed impeachment articles based on that diplomatic phone call, meaning doing so now injects his views into the 2020 presidential race.

Less than half of Americans polled by the nonpartisan Gallup organisation, 47 percent, approve of Mr Trump's handling of foreign policy. But his approval rating only climbed during the Ukraine-based impeachment trial and now stands at an all-time high, 49 percent, according to Gallup.

Getting 'played'

In less formal settings with reporters while he still worked for Mr Trump, the then-chief of staff acknowledged he knew his boss often had what had long been considered fringe views.

He once described his job as a "gatekeeper" of information, and said he tried to steer some widely dismissed views from landing inside Mr Trump's head. Mr Kelly made clear on Wednesday night that he was simply unable to talk the president out of holding two summits with North Korean leader Kim Jong Un, a man Mr Trump once called "Little Rocket Man."

"He will never give his nuclear weapons up," Mr Kelly said of Mr Kim. "Again, 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," he said in the longstanding Washington tradition of distancing oneself from a failed policy push after it crashed and burned. "And I never did think Kim would do anything other than play us for a while, and he did that fairly effectively."

The president has been pressed by reporters on whether he did indeed get, as Mr Kelly puts it, get "played." He contends Mr Kim is willing to give up his atomic arsenal, and has not ruled out a third summit -- showing again how Mr Trump puts his own perceived personal relationships above the advice of senior advisers, even ones like Mr Kelly who have been dealing with national security issues their entire careers.

After all, the president has remarkably described himself and Mr Kim as "in love."

Having it both ways

Can a former military leader or top White House aide have it both ways in the US political system? Without a doubt, yes. And Mr Kelly's Drew University comments and his actions since leaving the West Wing show why.

He joined the board of a company that provides shelters for immigrants. And then on Wednesday night, he said the president's proposed southern border wall need not stretch "from sea to shining sea."

Mr Kelly claims he disagreed with his boss that many migrants to the United States from the south are "killers" and "rapists" and general criminals.

"In fact, they're overwhelmingly good people ... They're not all rapists and they're not all murderers," he said of immigrants. "And it's wrong to characterise them that way. I disagreed with the president a number of times."

But while he was on the White House payroll, the retired four-star general was considered part of the immigration hardliner camp on Mr Trump's staff.

During several attempts by the White House to negotiate an immigration reform bill that could muster enough Democratic votes to pass both chambers of Congress, Democratic members involved said Mr Kelly never sought a truly moderate deal -- he was pushing the same conservative plan as Mr Trump.

One pro-immigrant group, America's Voice, summarises Mr Kelly tenures as Homeland Security secretary and White House chief of staff by labeling him as "extremist as his boss and a conduit for translating the administration's anti-immigrant extremism into disastrous policies."

The White House sharply fired back. "I worked with John Kelly, and he was totally unequipped to handle the genius of our great President," Press Secretary Stephanie Grisham said Thursday morning on Fox News.

A couple hours later, the president himself opted to take on his former chief of staff.

"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," he wrote, making clear he demands and expects silence from aides whom he sometimes presses to sign non-disclosure agreements.

The president also claimed in a second tweet that Mr Kelly has a "military and legal obligation" to remain quiet about his time in the West Wing and his views about Mr Trump. Only that Mr Kelly has never mentioned signing a non-disclosure pact and was not an active-duty Marine when he worked in the administration.

Mr Trump then got personal, writing about the former chief of staff's spouse.