President Trump’s firing of Defense Secretary Mark T. Esper, days after losing the election, and a Pentagon personnel shake-up that has followed have injected uncertainty into the ranks of national security leadership at a vulnerable moment for the United States, adding more turmoil to a period that already carries risk for the nation.

In the week since Election Day, Trump has refused to concede and has publicized spurious claims of fraud to overshadow the result. He also has declined to give President-elect Joe Biden resources and daily presidential intelligence briefings to aid the transition to the new administration. The Pentagon turmoil could further jeopardize the prospect of a seamless handover, at what experts say is a sensitive time.

“It is a time of vulnerability, and it’s a time when your enemies can be testing you,” said Martha Joynt Kumar, director of the nonprofit White House Transition Project. “It is the kind of thing that you have to get right.”

National security crises have challenged presidents during past transitions. The Iranian hostage crisis — after militant students stormed the U.S. Embassy in Tehran — came to a close in 1981 during the transition between Presidents Jimmy Carter and Ronald Reagan; the bombing of Pan Am Flight 103 over Lockerbie, Scotland, occurred in 1988 during the transition from Reagan to President George H.W. Bush; and Bush ordered U.S. troops into Somalia in his final weeks in office, in 1992, during the transition to President Bill Clinton.

Direct threats to the homeland have emerged during transitions as well. As George W. Bush welcomed President-elect Barack Obama to the White House for coffee on the morning of the 2009 inauguration, their respective national security aides sat in the Situation Room, discussing a possible threat to the event that U.S. intelligence had picked up from the extremist group al-Shabab, according to Kumar, who wrote a book about that transition.

The feared attack never took place, and the inauguration went off without a problem. But the Situation Room meeting, which came after joint crisis training sessions, underscored the vulnerability of the nation during presidential transitions — and how cooperation between the outgoing and incoming teams can reduce risk.

“Foreign adversaries believe that the United States is preoccupied during transitions, and it’s in our national security interest to demonstrate that we are not,” said David Marchick, director of the Center for Presidential Transition. He warned: “Failure to have a smooth transition could put our national security, our economic security and our health security at risk.”

Trump has signaled no interest in ensuring a seamless transition, instead proceeding as though he won a second term. The White House has told federal agencies to continue preparing for Trump’s budget submission to Congress in February.

The situation has prompted accusations that Trump is endangering the country.

“By destabilizing our national security team, we could increase the likelihood that one of our adversaries tries to take advantage of us,” Sen. Chris Murphy (D-Conn.), a member of the Senate Foreign Relations Committee, said in an interview. “Trump is always distracted, but he is particularly distracted now, and there’s now also the possibility of having a fractured or inexperienced or incomplete national security team to deal with a crisis.”

In addition to personnel changes, Trump also could make foreign policy moves before leaving office that could hem in Biden’s future choices, for example by increasing pressure on Iran to make reviving the 2015 nuclear accord even more difficult.

Foreign powers such as Russia, Saudi Arabia and Turkey that are likely to receive more pushback from a Biden administration could use the final months of the Trump administration to accomplish goals that might present challenges later, particularly if Washington is preoccupied with a chaotic presidential transition.

Neither Chinese President Xi Jinping nor Russian President Vladimir Putin has extended congratulations to Biden. A discordant transition could give both leaders an opportunity to make moves in their own regions.

China could extend its crackdown on Hong Kong or make a move on more disputed islands in the South China Sea, while Russia could take measures in its proxy war in the eastern part of Ukraine.

“Congress can fill part of the void,” Murphy said on Twitter. “Bipartisan statements, resolutions, and legislation can make clear there will be a cross-party consensus around consequences for any escalatory actions by other powers in the transition period.”

Uncertainty about how the United States would react during a lame-duck presidency could also deter foreign powers from taking the risk.

“The problem is, if you actually try to exploit it in a period of this kind of transition, you have absolutely no idea of what the American reaction would be, both immediately or over time,” said Anthony H. Cordesman, a foreign policy expert at the Center for Strategic and International Studies.

Another transition risk is the possibility that Trump administration officials will continue to declassify materials deemed politically helpful to the president and his allies. Before his firing, Esper had joined the National Security Agency director, Gen. Paul Nakasone, and CIA Director Gina Haspel in pushing against declassification of Russia-related materials, arguing that such moves would harm national security and the U.S. military, according to Washington Post columnist David Ignatius.

A chaotic transition could disadvantage the Biden administration if a crisis, in addition to the coronavirus pandemic, emerges during its first months in office.

The 1993 World Trade Center bombing, which left six people dead and more than 1,000 injured, occurred just a month after Clinton took office. The same month, federal law enforcement officers began a siege of a religious sect’s compound in Waco, Tex., that ended with the deaths of dozens of followers. When the siege began, Clinton didn’t have a confirmed attorney general. Two months later, authorities foiled a plot linked to Iraqi leader Saddam Hussein to assassinate George H.W. Bush during a visit to Kuwait.

The rocky transition between Clinton and George W. Bush in 2000, following a recount in Florida and subsequent Supreme Court case, delayed the final result by more than 30 days, halving the normal transition period. The 9/11 Commission Report later found “this loss of time hampered the new administration in identifying, recruiting, clearing and obtaining Senate confirmation of key appointees” ahead of the attacks of Sept. 11, 2001.

The report recommended that administrations minimize the disruption of national security policymaking during the transition by accelerating the process for key appointments, noting that the Bush administration didn’t have a team on the job with critical sub-Cabinet officials for at least six months, making the team less prepared to deal with the Sept. 11 attacks.

Russian interference in the 2016 election to boost Trump loomed over the transition from Obama to Trump four years ago, leading to the publication of a special U.S. intelligence report on the matter, scrutiny of incoming national security adviser Michael Flynn’s interactions with the Russian ambassador and later veto-proof sanctions on Russia that passed in the Senate.

The inexperience of the Trump team amplified the chaos during the transition and afterward. George W. Bush had 35 Senate-confirmed positions by the end of the first 100 days because of the shortened transition and Obama had 69; Trump had only 28, according to the Center for Presidential Transition.

Marchick said the Bush-Obama transition set a gold standard, in part because Bush made the matter a priority after his own rushed experience coming into office.

Biden is entering the White House after recent updates to the law — some of which were written and introduced by former senator Ted Kaufman (D-Del.), Biden’s longtime chief of staff in the Senate and head of his transition team — setting out requirements for the transfer of power.

Among other things, those changes require the creation of a White House transition coordinating council six months before the election. The Trump administration set up the council, which is chaired by White House Chief of Staff Mark Meadows and vice-chaired by Chris Liddell, the deputy chief of staff. The law also requires each federal agency to put a senior career employee in charge of the transition activities.

But Trump has refused to set in motion much of what the laws require. The administrator of the General Services Administration, a Trump appointee, is supposed to sign a formal notice to begin the transition but has declined to do so.

“Transitions have taken on a new form since 2010. Prior to 2010, they were much less formal, primarily in secret. After 2010, they have emerged as an important obligation of a candidate, and that’s because of legislation,” said Mike Leavitt, a former Utah governor who worked on the changes to the law after serving in George W. Bush’s Cabinet.

Leavitt said the first priority for the incoming administration is to choose a White House staff and the second priority is to select a national security team, including a national security adviser, secretary of state and defense secretary.

“One of the most important components and most important reasons for [an orderly] transition is that if you are a foreign power and looking for an opportunity to be harmful to the interests of the United States, you’d look for a period of confusion and a lack of controls — and those could potentially come in transitions,” Leavitt said.

The United States has endured disorderly and acrimonious transitions in the past. Presidents John Adams, John Quincy Adams and Andrew Johnson, for example, didn’t attend the inaugurations of their successors. During the transition from James Buchanan to Abraham Lincoln, seven Southern states seceded from the Union, setting the stage for the Civil War.

“Chaos is probably more the historical normal, but recently we have established new standards, and that’s appropriate — and the question is: Will the current administration meet the task?” said Stephen Hadley, who served as George W. Bush’s national security adviser and played a crucial role in the Bush-Obama transition.

Hadley said that even if Trump doesn’t support the transition, people in his administration and career employees at the agencies understand the importance of a presidential handover and are determined to have a good transition.

“If the president doesn’t disrupt it, it will happen,” he said.