Washington CNN  — 

In December 2018, then-President Donald Trump announced on Twitter that he would nominate Gen. Mark Milley as the next chairman of the Joint Chiefs. Milley was not the consensus pick, and then-Defense Secretary James Mattis objected to his selection. But Trump wanted the square jawed, barrel-chested general whom he saw as straight from central casting as his top military officer.

Nearly three years later, Milley has transformed from Trump’s hand-picked general – who accompanied the President to his infamous photo-op at St. John’s Church during the George Floyd protests – to one of Trump’s harshest critics in the slew of scathing books released this summer on the final months of the Trump presidency.

According to the upcoming book from Washington Post reporters Carol Leonnig and Philip Rucker, “I Alone Can Fix It,” Milley was deeply concerned Trump and his allies might attempt a coup after the November 2020 election, and he compared Trump’s lies about election fraud to the rhetoric used by Adolf Hitler as he rose to power in Germany.

“This is a Reichstag moment,” Milley told his aides, according to the book. “The gospel of the Führer.”

The startling comments in the new book were only the latest instance where Milley, who remains the chairman of the Joint Chiefs in the Biden administration, found himself in the middle of major political fights in both the Trump era and during the fallout from the January 6 insurrection.

It’s an odd role for the nation’s top military official to play, but one that Milley has been thrown into thanks in large part to Trump. While Milley has sought to distance himself from politics, it was often impossible to do so while working for the former President, even after he left office.

In many ways, Milley has come full circle: The Joint Chiefs chairman has gone from being accused by critics of being an enabler of Trump – defending the decision to strike Iranian general Qasem Soleimani and accompanying Trump to St. Johns Church – to being seen as a key defender of democracy at a time when Milley and those around him feared it was under threat from the commander in chief.

After joining in Trump’s photo-op, Milley apologized a week later for being there, saying it was inappropriate. He then bucked Trump by supporting efforts to study the renaming of bases named after Confederate leaders, saying they were traitors. And since January 6, Milley has clashed with Republicans who have sought to downplay the attack and the need to investigate it.

Now he’s being attacked by the likes of Fox News’ Tucker Carlson and GOP Rep. Matt Gaetz of Florida, two mainstays of the pro-Trump wing of the Republican Party.

After the new revelations about Milley’s actions and views surrounding the January 6 insurrection came out this week, Trump wasted little time before trashing Milley in a lengthy statement in response to the book excerpts.

“I never threatened, or spoke about, to anyone, a coup of our Government,” Trump said. “If I was going to do a coup, one of the last people I would want to do it with is General Mark Milley.”

Milley does not plan to publicly address the issues raised in the book, according to a defense official close to him.

The official acknowledged that during the final weeks of the Trump administration, Milley engaged in activities and communications not part of the traditional portfolio of a Joint Chiefs chairman, carrying a heavier political load to keep Trump in check. While Milley “tried his hardest to actively stay out of politics,” the official said, if the events that occurred brought him into that arena temporarily, “so be it.”

“He’s not going to sit in silence while people try to use the military against Americans,” the official said.

‘By no one. Ever’

Milley, 63, still has two years left of his four-year term as Joint Chiefs chairman, the culmination of a four-decade Army career in which the four-star general has commanded units with the 10th Mountain Division and the 101st Airborne and served multiple combat tours in Iraq and Afghanistan. He’s the first Joint Chiefs chairman in nearly 20 years with a special-forces background.

Born and raised outside Boston, Milley went to Princeton, where he joined the Reserve Officers’ Training Corps. He received his Army officer commission upon graduating in 1980, taking a different route to the Army than the traditional path of attending the United States Military Academy at West Point.

At his confirmation hearing in 2019, Milley was asked bluntly whether he would be intimidated by anyone in his role.

“Absolutely not. By no one. Ever,” Milley responded. “I’ll give my best military advice. It’ll be candid. It’ll be honest. It’ll be rigorous and it’ll be thorough. And that’s what I’ll do every single time.”

Not long after he was confirmed and became chairman in October 2019, Milley faced blowback on Capitol Hill in the wake of Trump’s controversial decision to launch airstrikes killing Soleimani, something many Democrats warned could lead to conflict or even war with Iran.

Milley vigorously defended the decision in closed-door briefings with Congress, calling the intelligence that prompted the attack “exquisite.” Several Democrats said Milley came across as trying to match Trump’s bombast, and they bristled at the attitude he had taken.

Then in June, Milley and Defense Secretary Mark Esper accompanied Trump on a walk from the White House to St. John’s Church, just minutes after protesters were violently cleared from Lafayette Square in front of the White House.

The Pentagon leaders faced a barrage of criticism for taking part in the photo-op Trump held, and a week later, Milley apologized for being there.

“I should not have been there. My presence in that moment and in that environment created a perception of the military involved in domestic politics. As a commissioned uniformed officer, it was a mistake that I have learned from, and I sincerely hope we all can learn from it,” Milley said in a speech to graduates at National Defense University.

‘An act of treason’

Behind the scenes, Milley and Esper were pushing back against Trump’s desire to use active-duty troops in response to violent protests that broke out following the death of George Floyd, an unarmed black man killed last year by a Minneapolis police officer.

According to a new book from the Wall Street Journal’s Michael Bender, Trump told his top military and law enforcement officials he wanted the military to go in and “beat the f**k out” of the civil rights protesters. “Crack their skulls!” Trump said, according to the book, prompting objections from Milley and Attorney General William Barr.

A month later, Milley was also at odds with Trump over a plan in Congress to rename bases named for Confederate leaders, which Trump had vocally objected to.

“It was an act of treason, at the time, against the Union, against the Stars and Stripes, against the US Constitution,” Milley told a House committee in July 2020, expressing his support for a commission to look at renaming the bases.

In the weeks leading up to the election, Trump ramped up attacks on his military leaders, charging in September that top Pentagon officials “want to do nothing but fight wars so that all of those wonderful companies that make the bombs and make the planes and make everything else stay happy.”

Milley soon found himself publicly feuding in October with Trump’s national security adviser, Robert O’Brien, over plans to withdraw US troops from Afghanistan, while Trump was tweeting that the remaining 4,500 troops should be “home by Christmas.”

‘The guys with the guns’

After the election, Trump’s blustery rhetoric turned into action when he fired Esper and installed loyalists at the Pentagon, raising Milley’s fears that Trump or his allies could try to attempt a coup to overturn the election results.

According to Leonnig and Rucker, Milley was shaken by the threat of a coup and felt he had to be “on guard” for what might come.

“They may try, but they’re not going to f**king succeed,” Milley told his deputies, according to the authors. “You can’t do this without the military. You can’t do this without the CIA and the FBI. We’re the guys with the guns.”

Milley and the rest of the Joint Chiefs informally planned for what they would do in the event of an order they deemed illegal, dangerous or ill-advised, including a proposal to resign, one-by-one, rather than carry out the orders.

After the January 6 attack, Milley and the entire Joint Chiefs of Staff issued a statement condemning the “sedition and insurrection” of the rioters who breached the Capitol and attacked police officers.

Milley focused his efforts on ensuring there was a “ring of steel” around the city for the January 20 inauguration of President Joe Biden, according to Leonnig and Rucker. “We’re going to put a ring of steel around this city and the Nazis aren’t getting in,” Milley said.

‘I personally find it offensive’

But Milley’s relief after the peaceful transfer of power was completed did not mean he was able to put the chaos of January 6 behind him.

As Republicans in Congress played down the violence that occurred on January 6 and opposed efforts to investigate what happened, Milley found himself on the defensive at a June congressional hearing when Republicans questioned the Pentagon’s efforts on diversity and combating extremism.

Defense Secretary Lloyd Austin tried to be diplomatic with the GOP lawmakers in the hearing, as is often the case for Pentagon leaders dealing with members of Congress trying to score political points.

But Milley forcefully pushed back, prompting a wave of attacks from conservative media and Fox News commentator Tucker Carlson.

“I want to understand White rage and I’m White,” Milley said. “What is it that caused thousands of people to assault this building and try to overturn the Constitution of the United States of America?”

Milley, who has studied history, noted that he had read Mao, Karl Marx and Vladimir Lenin.

“That doesn’t make me a communist,” Milley said. “I personally find it offensive that we are accusing the United States military, our general officers, our non-commissioned officers of being ‘woke’ or something else because we’re studying some theories that are out there.”

CORRECTION: An earlier version of this story misspelled the name of Vladimir Lenin.

CNN’s Barbara Starr, Oren Liebermann and Zachary Cohen contributed to this report.