A presidential transition can be a perilous time in the world. That’s particularly true when the departing president denies that he is departing and fires America’s top defense officials.

President Donald Trump dismissed Defense Secretary Mark Esper and several other top national security officials across the government. At the Pentagon, he has appointed four new top officials, one of them an extremist who had publicly called President Barack Obama a “terrorist leader.” Another hard-liner was installed at the National Security Agency over its director’s objections, and two senior officials at the Department of Homeland Security have been forced out.

Rumors fly that the purge may continue with the removal of FBI director Christopher Wray and CIA director Gina Haspel. The president’s oldest son, Donald Trump Jr., denounced Haspel a few days ago as “a trained liar.”

The new appointments may increase the risk of aggressive action toward Iran. And the upheaval certainly undermines our national security in a transition period that is already fraught.

“Trump has figuratively decapitated our operational civilian leadership in the Pentagon,” James Stavridis, a retired admiral and supreme allied commander of NATO, told me in an email. “Jubilant high-fives are the order of the day in Beijing, Moscow, Tehran and Pyongyang.”

He added: “I worry about a North Korean or Iranian miscalculation, thinking the U.S. is too distracted to respond appropriately to a fresh tanker seizure in the Arabian Gulf or a new long-range ballistic missile test — something either might do to gain leverage in negotiations with the incoming administration. Similarly, China could move even more aggressively on Hong Kong or even worse Taiwan, while Russia might be tempted to launch a significant cyberattack.”

The greatest risks may be in Asia. North Korea still hasn’t demonstrated that it has a warhead capable of surviving reentry into the Earth’s atmosphere — and Kim Jong Un may feel that this is the time to do so, thus presenting Joe Biden with a fait accompli.

North Korea has probably absorbed the lesson that nobody pays attention to it when it’s calm and reasonable, and that it gets rewards only when it threatens mayhem. On the plus side, a negotiated deal is easier to imagine now than a few years ago, and after Trump’s meetings with Kim, it may be more difficult for Republicans to denounce Biden for negotiating with North Korea.

The scariest possibility would be a Chinese move on Taiwan. President Xi Jinping may want to signal to the United States and Taiwan alike that any deepening of ties will carry a steep price. If so, Xi might prefer to lay down that marker in the transition so that Biden isn’t forced to respond.

The risk isn’t so much an all-out invasion of Taiwan as it is a lesser step meant as a warning shot across the bow: snipping of undersea telecommunications cables that carry the internet to Taiwan, turning out the lights with a cyberattack, impeding oil tankers in ways that alarm investors and tank the stock market — and, from Xi’s point of view, teach Taiwan a lesson. Clashes could quickly escalate, for Taiwan would want China to pay a price for such bullying.

“Beijing might calculate that the time is ripe for a move on one of Taiwan’s outer islands, but it would sacrifice any opportunity for a moderated U.S. position toward China once President-elect Biden takes office,” noted Elizabeth Economy, a China expert with Stanford University’s Hoover Institution.

Beijing should also realize that any provocation could backfire and result in closer ties between the United States and Taiwan, plus pressure to boycott the Beijing Winter Olympics in 2022.

One not-so-reassuring sign, Economy noted, is that China recently proved willing to sacrifice its larger relationship with India over a border dispute.

As for Iran, most experts believe that it will be on good behavior in hopes of getting a fresh start with Biden — unless it is provoked by some aggressive step concocted by the newly installed hard-liners in the Pentagon. In other words, any dangerous provocation is more likely to originate in Washington, not Tehran.

Another risk is that Israel may conclude that the next two months offer a last chance to strike Iranian nuclear sites with support from Washington. The ensuing storm would reverberate through the region and might make it impossible for Biden to get Iran back into the nuclear accord.

Robert Malley, president of the International Crisis Group, said that one risk generally is that governments may prefer to take aggressive steps now, while the United States is distracted. For example, Ethiopia’s prime minister has ignited a civil war and Azerbaijan began an offensive against an ethnic Armenian enclave. There’s no proof that the timing for either was shaped by events in Washington — but if you’re an autocrat, this is not a bad time to start a war.

“Any transitional period presents foreign policy risks,” Malley said, “but a transitional period involving Trump by definition magnifies them.”

Nicholas D. Kristof | The New York Times (CREDIT: Damon Winter/The New York Times)

Contact Nicholas Kristof at Facebook.com/Kristof, Twitter.com/NickKristof or by mail at The New York Times, 620 Eighth Ave., New York, NY 10018.