KABUL — The abrupt resignation of President Ashraf Ghani’s national security adviser and reports of turmoil involving three other top officials have exposed deep conflict and confusion in the U.S.-backed government over how to protect the country and deal with an insurgency that might be seeking to end the 17-year conflict.

The shake-up this past weekend deepened concern about the government’s solidity and Ghani’s increasing isolation. It comes as a new U.S. military commander is preparing to take up his post in Kabul, and U.S. scrutiny of Afghan policy is expected to intensify.

On Monday, Ghani’s office announced that the Russian government had agreed to postpone a Sept. 4 meeting in Moscow on the Afghan conflict, to “ensure Afghanistan’s participation.” Russia confirmed the postponement of the session, which was to include China, Pakistan, Iran and India.

Taliban leaders had agreed to attend the meeting — after ignoring a truce offer by Ghani — but Afghan and U.S. officials had refused to participate, on the grounds that it would undermine efforts for reconciliation inside Afghanistan.

A statement from the Russian foreign ministry said Ghani had asked to reschedule the meeting to “work out a consolidated Afghan position . . . given the ongoing reshuffling in the leadership of Afghan defense agencies.”

But Ghani’s forceful move on the talks did little to dispel the growing impression of disarray within his government over security issues.

Both Afghan and U.S. analysts said the sense of chaos in Kabul could weaken the Trump administration’s confidence in Ghani as a reliable partner in improving the Afghan security forces’ fighting ability and leadership — and thereby tip the balance in a stalemated war with the insurgents. 

The Taliban have been making steady gains across the country. Two recent attacks deeply embarrassed the Ghani government, apparently prompting the current conflict with his aides. Early this month, the militants launched a deadly four-day siege of Ghazni, a large city south of Kabul, which was eventually quelled by Afghan reinforcements and U.S. airstrikes.

Last Tuesday, while the president was delivering a televised speech in his palace, a barrage of mortars was fired from nearby, interrupting his address. The attackers, holed up in an empty warehouse, were later killed by a helicopter airstrike, but the capital’s vulnerability was dramatically exposed.

“The government is already in deep political crisis, under tremendous military pressure and facing uncertainty about the presidential elections,” said Haroun Mir, an analyst in Kabul, referring to a scheduled April vote. With Washington’s hopes for military and economic progress in Afghanistan resting heavily on Ghani, Mir said, “further fragmentation and division will undermine the American strategy in Afghanistan.”

Mir and others also expressed concern that the angry departure of security adviser Hanif Atmar has exacerbated political divisions within the highest circles of government. Ghani plans to run for reelection, and Atmar — long considered among his most loyal and capable aides — is now expected to join the opposition and almost certainly become a serious contender for the presidency.

“Ghani has lost an asset,” said Amrullah Saleh, a former head of the national intelligence agency. He said Atmar was a “sound strategist with patience and strength to reach out to critics.” He described “an intense conflict within the entourage of Ghani” and added: “Afghanistan needs a stable government, or at least a stable team within the government, but that seems lacking.”

Ghani said he had accepted Atmar’s resignation and replaced him with his ambassador to Washington, Hamdullah Mohib. The ministers of defense and interior, as well as the national intelligence chief, remained in their jobs, but there were conflicting reports about whether they had all threatened to resign or whether Ghani had asked them to do so and then changed his mind.

A former U.S. official and Afghan expert in Washington, speaking on condition of anonymity to express candid views, described the problems of Ghani’s administration in dire terms. He said the growing sense of chaos might give the Taliban another reason to shun the government and continue the war.

“Everything seems to be coming to a very fragile and potentially dynamic point. Atmar’s resignation epitomizes the fact that this crisis is crossing over into a whole range of issues,” the former official said. Ghani “badly needed to do something about the deteriorating security situation, but the way he did it, appointing a loyalist instead of bringing in someone with experience, will probably weaken the rest of his tenure.” 

The crisis in Afghan security leadership comes just as the Trump administration is changing its military commander in Afghanistan. Gen. John W. Nicholson , who has led the U.S. military mission here since 2016 and has built a close working relationship with Ghani while overseeing about 16,000 advisory troops, will be replaced next week by Lt. Gen. Austin Miller , who heads the U.S. military’s Joint Special Operations Command. 

The administration is also reportedly about to name a special envoy to Kabul, a post that has been vacant since the Obama administration ended, in what analysts called an effort to signal new commitment to peace talks and outreach to Afghan society. The appointee is expected to be Zalmay Khalilzad, 67, an Afghan American and Republican foreign policy expert who has served as U.S. ambassador to Afghanistan and Iraq. The State Department has not confirmed the appointment. 

These changes will almost certainly bring a fresh U.S. look at the state of the Afghan conflict and prospects for peace, especially given the new efforts at involvement by Russia and the newly elected government in Pakistan, where Prime Minister Imran Khan has sent mixed signals about Pakistani relations with the United States and Afghanistan. 

Amie Ferris Rotman and Sayed Salahuddin contributed to this report.