In the waning weeks of Donald Trump’s term, the country’s top military leader repeatedly worried about what the president might do to maintain power after losing reelection, comparing his rhetoric to Adolf Hitler’s during the rise of Nazi Germany and asking confidants whether a coup was forthcoming, according to a new book by two Washington Post reporters.

As Trump ceaselessly pushed false claims about the 2020 presidential election, Gen. Mark A. Milley, chairman of the Joint Chiefs of Staff, grew more and more nervous, telling aides he feared that the president and his acolytes might attempt to use the military to stay in office, Carol Leonnig and Philip Rucker report in “I Alone Can Fix It: Donald J. Trump’s Catastrophic Final Year.”

Milley described “a stomach-churning” feeling as he listened to Trump’s untrue complaints of election fraud, drawing a comparison to the 1933 attack on Germany’s parliament building that Hitler used as a pretext to establish a Nazi dictatorship.

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

A spokesman for Milley declined to comment.

Portions of the book related to Milley — first reported Wednesday night by CNN ahead of the book’s July 20 release — offer a remarkable window into the thinking of America’s highest-ranking military officer, who saw himself as one of the last empowered defenders of democracy during some of the darkest days in the country’s recent history.

The episodes in the book are based on interviews with more than 140 people, including senior Trump administration officials, friends and advisers, Leonnig and Rucker write in an author’s note. Most agreed to speak candidly only on the condition of anonymity, and the scenes reported were reconstructed based on firsthand accounts and multiple other sources whenever possible.

The roots of former president Donald Trump’s power in the Republican Party can be traced back to the backlash following the 2008 election and financial crisis. (Blair Guild, JM Rieger/The Washington Post)

Milley — who was widely criticized last year for appearing alongside Trump in Lafayette Square after protesters were forcibly cleared from the area — had pledged to use his office to ensure a free and fair election with no military involvement. But he became increasingly concerned in the days following the November contest, making multiple references to the onset of 20th-century fascism.

After attending a Nov. 10 security briefing about the “Million MAGA March,” a pro-Trump rally protesting the election, Milley said he feared an American equivalent of “brownshirts in the streets,” alluding to the paramilitary forces that protected Nazi rallies and enabled Hitler’s ascent.

Late that same evening, according to the book, an old friend called Milley to express concerns that those close to Trump were attempting to “overturn the government.”

“You are one of the few guys who are standing between us and some really bad stuff,” the friend told Milley, according to an account relayed to his aides. Milley was shaken, Leonnig and Rucker write, and he called former national security adviser H.R. McMaster to ask whether a coup was actually imminent.

“What the f--- am I dealing with?” Milley asked him.

The conversations put Milley on edge, and he began informally planning with other military leaders, strategizing how they would block Trump’s order to use the military in a way they deemed dangerous or illegal.

If someone wanted to seize control, Milley thought, they would need to gain sway over the FBI, the CIA and the Defense Department, where Trump had already installed staunch allies. “They may try, but they’re not going to f---ing succeed,” he told some of his closest deputies, the book says.

In the weeks that followed, Milley played reassuring soothsayer to a string of concerned members of Congress and administration officials who shared his worries about Trump attempting to use the military to stay in office.

“Everything’s going to be okay,” he told them, according to the book. “We’re going to have a peaceful transfer of power. We’re going to land this plane safely. This is America. It’s strong. The institutions are bending, but it won’t break.”

In December, with rumors circulating that the president was preparing to fire then-CIA Director Gina Haspel and replace her with Trump loyalist Kash Patel, Milley sought to intervene, the book says. He confronted White House Chief of Staff Mark Meadows at the annual Army-Navy football game, which Trump and other high-profile guests attended.

“What the hell is going on here?” Milley asked Meadows, according to the book’s account. “What are you guys doing?”

When Meadows responded, “Don’t worry about it,” Milley shot him a warning: “Just be careful.”

After the failed insurrection on Jan. 6, House Speaker Nancy Pelosi (D-Calif.) called Milley to ask for his guarantee that Trump would not be able to launch a nuclear strike and start a war.

“This guy’s crazy,” Pelosi said of Trump in what the book reported was mostly a one-way phone call. “He’s dangerous. He’s a maniac.”

Once again, Milley sought to reassure: “Ma’am, I guarantee you that we have checks and balances in the system,” he told Pelosi.

Less than a week later, as military and law enforcement leaders planned for President Biden’s inauguration, Milley said he was determined to avoid a repeat of the siege on the Capitol.

“Everyone in this room, whether you’re a cop, whether you’re a soldier, we’re going to stop these guys to make sure we have a peaceful transfer of power,” he told them. “We’re going to put a ring of steel around this city and the Nazis aren’t getting in.”

At Biden’s swearing-in on Jan. 20, Milley was seated behind former president Barack Obama and former first lady Michelle Obama, who asked the general how he was feeling.

“No one has a bigger smile today than I do,” Milley replied. “You can’t see it under my mask, but I do.”