They almost finalized a deal with the insurgents last summer that would have pushed back the election, but President Trump called off the talks on the eve of the signing, and the vote went ahead.

The political showdown pits the technocratic Mr. Ghani and his circle of young advisers against some of the most hardened figures of the recent Afghan history, survivors of years of battle and deal-making. One of Mr. Abdullah’s key supporters is Gen. Abdul Rashid Dostum, who has been accused of an array of violent acts, and until recently served as Mr. Ghani’s vice president.

General Dostum, who has one of the most unified bases of support in the north, was the first to call for a parallel government, and to urge protests and the announcement of governors in northern provinces. Mr. Abdullah’s fate could turn on how willing the general is to push the crisis, and how receptive he is to a deal with Mr. Ghani.

Mr. Khalilzad, who was expected to return to Doha to prepare for the signing ceremony, has extended his stay in Afghanistan to manage the political tensions, meeting repeatedly with Mr. Ghani, Mr. Abdullah and other key political players.

Late on Thursday, Mr. Khalilzad told a meeting of General Dostum’s party that the announcement of election results had caught him by surprise, according to one participant. He and Gen. Austin S. Miller, the top American commander in Afghanistan, urged the participants to make sure that political rallies don’t turn to violence.

Analysts said the conflict was unlikely to affect the first steps of the peace process, as U.S. officials had made it clear to everyone that their priority was starting the violence reduction. But the high-stakes political showdown would make it difficult to move on to the next phase, when a unified negotiating team that includes the Afghan government is expected to sit across from the Taliban.