THE BEST-CASE scenario is that President Trump’s firing-by-Twitter of Defense Secretary Mark T. Esper on Monday was a reckless act of vindictiveness by a lame-duck president who wanted to settle a score. The worst is that it is the beginning of a decapitation of national security agencies that could leave the country rudderless at a sensitive moment, and perhaps open the way for Mr. Trump to engage in dangerous adventurism at home or abroad. Either way, Mr. Esper’s “termination,” as the president styled it, underlines that Mr. Trump will remain a serious threat to the national interest for the next 10 weeks.

Mr. Esper had been on Mr. Trump’s hit list since June, when he publicly as well as privately resisted suggestions by Mr. Trump that active-duty troops be deployed in U.S. cities to suppress Black Lives Matter demonstrations. This came after Mr. Trump dragooned the defense secretary and Joint Chiefs of Staff Chairman Mark A. Milley into accompanying him in his march across a Lafayette Square cleared of demonstrators by tear gas and baton charges.

Mr. Esper, who had been ridiculed as “Yesper” earlier in his tenure, also angered the White House by suggesting that military bases named after Confederate generals could be retitled. He and senior military commanders have resisted Mr. Trump’s sporadic attempts to abruptly order home the remaining U.S. troops in Afghanistan and Syria. One question is whether the president will now push for those pullouts with the acting secretary he installed, Christopher C. Miller. Mr. Miller, a former Special Forces officer and mid-level official at the National Security Council and Pentagon, has a fine record, but he is not well positioned either to manage the Pentagon or to resist Mr. Trump’s impulses.

Mr. Esper is the most prominent of a clutch of officials removed since the election, including the deputy administrator of the U.S. Agency for International Development and the chief of the program that produces the federal government’s annual climate change report. And they may not be the last: Widespread reports have said that Mr. Trump may dismiss CIA Director Gina Haspel and FBI Director Christopher A. Wray. Both are highly competent and nonpartisan professionals; the FBI director’s 10-year term is meant to insulate him from politics. Nevertheless, Mr. Trump reportedly holds grudges against both for failing to support his reelection campaign by releasing sensitive intelligence or launching investigations of his opponents.

A broader purge would be an invitation to U.S. adversaries to take advantage by launching aggressions they otherwise would not contemplate; a Russian intervention in Belarus or a Chinese foray against Taiwan, for example. At worst, Mr. Trump may be contemplating desperate actions to maintain himself in office. That’s why, rather than indulging the president’s groundless claims of election fraud, senior Republicans ought to be pressing him to accept his defeat and cooperate in a transition that protects U.S. national security. They should consider the warning of Mr. Esper, who after serving under Mr. Trump for 16 months told an interviewer: “Who’s going to come in behind me? It’s going to be a real ‘yes man.’ And then God help us.”

Read more: