KABUL, Afghanistan — Their campaign workers traded blows over ballot boxes during an election widely seen as fraudulent. Some of the warlords backing them have muttered about starting a parallel government, a potential recipe for civil war in Afghanistan. And they’ve just come out of a vote so discredited that some officials don’t want the final tallies announced.

Now Ashraf Ghani, Afghanistan’s new president-elect, and his opponent, Abdullah Abdullah, have joined together in a national unity government in which they will share power.

After eight months of enmity over the protracted presidential election, with two rounds of voting, an international audit and power-sharing negotiations finally behind them, they will have to confront the challenges of jointly governing a country that in many ways is far worse off than it was before the campaign began last February.

The Taliban have had one of their most successful fighting seasons since the beginning of the war, and the security forces are reeling from heavy casualties, a high desertion rate and poor morale. The Afghan economy is battered by election uncertainty and rising unemployment, and in desperate need of emergency financing from the United States and other donors.