Chairman of the Joint Chiefs Gen. Mark Milley feared former President Trump would try to use the military to stay in power after his attempts to overturn the results of the 2020 election failed, according to a Monday report.

While Milley played a relatively quiet role in the opening years of Trump's presidency, he came to a crossroads in 2018 when he accompanied Trump during his infamous march across Lafayette Square outside the White House, the New Yorker reported.

Protesters had been moved aside for Trump's display, and Milley would later apologize for attending, saying his presence gave the impression that the military was operating against Trump's opponents.

"As many of you saw, the result of the photograph of me at Lafayette Square last week. That sparked a national debate about the role of the military in civil society," Milley said at the time. "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," he added.

Milley reportedly drafted a resignation letter following the incident, but decided not to send it to Trump.

"F*** that s***, I’ll just fight him," He reportedly told his staff. "If they want to court-martial me, or put me in prison, have at it. But I will fight from the inside."

MILLEY DIRECTS A REVIEW OF US, CHINESE MILITARY CONTACTS AMID WARNING BEIJING POSES NATIONAL SECURITY THREAT

Gen. Mark Milley during a virtual conference

Joint Chiefs Chairman Gen. Mark Milley speaks with reporters after a virtual meeting of the Ukraine Defense Contact Group at the Pentagon, Monday, May 23, 2022, in Washington.  ((AP Photo/Alex Brandon))

As the 2020 election neared, Milley reportedly grew increasingly concerned that Trump may start a foreign war and use the military to secure authority on the domestic front.

Milley, "envisioned a declaration of martial law or a Presidential invocation of the Insurrection Act," according to the New Yorker.

By late November 2020, Milley was reportedly solely focused on ensuring a transfer of power to then-President-Elect Joe Biden.

"Our job is to land this plane safely and to do a peaceful transfer of power the twentieth of January," Milley told staff at the time. "This is our obligation to this nation."

When Trump's supporters stormed the U.S. Capitol on January 6, Milley told the New Yorker it was ultimately Vice President Mike Pence who ordered the National Guard to respond.

CLICK HERE TO GET THE FOX NEWS APP

Trump would later claim he had advised the deployment of 10,000 National Guard troops to the Capitol in the days before the rally, but Congressional leaders opposed the idea.