Gen. Mark A. Milley has some explaining to do — and not just about his phone calls with a Chinese general.

In their forthcoming book “Peril,” Bob Woodward and Robert Costa reveal that Milley was so concerned President Donald Trump might start a nuclear war with China, he took the extraordinary step of calling his Chinese counterpart and promising him, “If we’re going to attack, I’m going to call you ahead of time. It’s not going to be a surprise.” Following the Jan. 6 Capitol riot, Milley told House Speaker Nancy Pelosi (D-Calif.) he agreed that Trump was “crazy” and made senior officers at the National Military Command Center take an “oath” not to execute Trump’s order for a nuclear strike without consulting him first — even though he is not in the military chain of command.

The idea that Trump would start a nuclear war is ludicrous; one of his proudest achievements is being the first president since Ronald Reagan not to start a new war. When Milley appears before the Senate Armed Services Committee on Sept. 28, he will have to answer for his astonishing actions and explain why they did not usurp civilian authority.

But the fact that so many intimate details that only Milley and his inner circle would know made it into this book suggests that Milley wanted history to record that he was one of the “adults in the room” who averted disaster in the final days of Trump’s presidency.

Well, if Milley wants credit for stopping Trump from causing an imagined military disaster, then he also gets the blame for not stopping President Biden from causing an actual military disaster. Where was this bold, brazen general — willing to bend the chain of command in the name of national security — when Biden oversaw the worst U.S. military catastrophe in modern times in Afghanistan?

When Trump was in office, Milley had no compunction about standing up to the president on Afghanistan. Axios’s Jonathan Swan reports that after the 2020 elections, unbeknown to his national security team, Trump had a presidential decision memorandum drawn up ordering all U.S. forces be withdrawn from Afghanistan by Jan. 15, 2021. When news reached the Pentagon, Milley was “appalled” and swung into action. In the Oval Office, Milley, national security adviser Robert O’Brien and acting defense secretary Christopher C. Miller “all aligned against the plan.” They “painted a vivid picture of Kabul falling to the Taliban if U.S. forces withdrew precipitously in the final days of the Trump presidency” and invoked the specter of America’s withdrawal from Saigon, warning “this would be Trump’s legacy if he rushed to the exit.” In the end, they persuaded Trump to leave a residual force of 2,500 troops in Afghanistan when he left office.

So where was Milley’s pushback when Biden decided to withdraw those last 2,500 U.S. forces on a political timetable, so the evacuation would be completed by the 20th anniversary of the 9/11 attacks? Where were his dire warnings of an impending Saigon-like disaster? In an interview with George Stephanopoulos, Biden claimed that none of his military advisers had recommended leaving a residual force. But Milley knew better. Politico reported in April that “Milley, Central Command chief Gen. Frank McKenzie and Afghanistan forces commander Gen. Austin Miller believe that a force of 3,000 to 5,000 is required to conduct counterterrorism and as leverage to force the Taliban to negotiate.” Milley feared that anything less would lead to a “repeat of what happened in Iraq after the U.S. drawdown in 2011” when the Islamic State rose from the ashes and spread its murderous tentacles across the globe.

He understood that Biden’s plan would lead to disaster. So why did Milley stand by while Biden executed the catastrophic withdrawal he had dissuaded Trump from carrying out? Why did he go along with a plan that had us quit Bagram air base, and put the safety of U.S. service members securing the airport in the hands of the Taliban and the Haqqani network — a U.S.-designated terrorist organization? Why did he agree to leave American citizens, permanent residents, visa holders and the United States’ Afghan allies behind enemy lines? Why, when our NATO allies pleaded with Biden to extend the artificial deadline he had set for the U.S. withdrawal so they could evacuate their nationals and allies, didn’t Milley stand with them?

And if Biden didn’t listen, why didn’t Milley put his stars on the table?

Milley wanted to be remembered for saving us from Trump. Instead, he will be remembered for enabling Biden as he presided over the worst national security debacle in modern American history. While he may come up with an excuse for his actions in the waning days of the Trump presidency, there is no excuse for that.