Ashraf Ghani and Abdullah Abdullah have agreed to work together in a deal brokered by US Secretary of State John Kerry.
The bitter feud between the two men had threatened to plunge the fragile country into chaos as Taliban insurgents increase their attacks.
Correspondent: Karon Snowdon
Speakers: John Kerry, US Secretary of State; Afghan Presidential candidates: Ashraf Ghani, Abdullah Abdullah; Samina Ahmed, South Asia Project Director, International Crisis Group; Professor William Maley, Director, ANU' s Asia Pacific College of Diplomacy
SNOWDON: Of late, John Kerry has been a busy US emissary. Just days after the death of the most senior US military officer killed in Afghanistan he made a surprise visit to the country.
KERRY: It is a pivotal moment for Afghanistan, the stakes are high.
SNOWDON: Both candidates had accused the other of massive vote rigging but now agree to accept the result of an audit of all eight million contested votes to be finished by the end of the month. Two rounds of counting have given the lead to first one and then the other, with the latest showing former Finance Minister Ashraf Ghani ahead.
GHANI: This communique reflects our sense of national obligation and our duty to put the interests of Afghanistan above everything else.
SNOWDON: His rival former, Foreign Minister Abdullah Abdullah, also promised to work for the good of the country as it enters what he calls a "new phase".
ABDULLAH: We are committed to working together on the bases of our common vision for the future of the country.
SNOWDON: The devil however is in the detail. Samina Ahmed, the South Asia Project Director for the International Crisis Group says the agreement is a crucial first step on a long road to achieving stability.
AHMED: The next step is how do they decide on the losing team, how it is going to be represented in the next executive. So it's not going to be easy going. But at least for this very crucial period Afghanistan would have moved forward.
SNOWDON: Professor William Maley, Director of the ANU's Asia Pacific College of Diplomacy, says success depends on continued goodwill between the two warring candidates.
MALEY: So in a way, it's an agreement to reach an agreement, but what the specific details will be remains to be determined.
SNOWDON: And what stick or carrot do you think John Kerry waved over the heads of these two men?
MALEY: The overwhelming stick which can be waved is a threat to discontinue the kind of aid packages on which Afghanistan's going to be dependent for quite sometime in the aftermath of the troop withdrawal. Already, with international forces pulling out of Afghanistan, demand for locally-produced goods and services is going down and unemployment is beginning to go up. So it's very much in the interest of both candidates to see a commitment from the United States and its allies to remain engaged with Afghanistan, otherwise the problems that they face will be very large indeed.
SNOWDON: Foreign troops are set to leave Afghanistan by December. Outgoing President Hamid Karzai refused to negotiate a Bilateral Security Agreement with the United States as a condition for ongoing support. Samina Ahmed says other nations also won't come onboard unless the BSA is signed.
AHMED: So in both cases, why are these crucial? One, a commitment made which will be seen as extremely hopeful within Afghanistan by the Afghan people, of continued international support. Second, a signal sent to the insurgents that the international community might be leaving, but they're not running for the exit. They're still committed to Afghanistan.
SNOWDON: In the long run, William Maley says one of the keys to Afghanistan's future lies across its borders.
MALEY: The main determent is going to be what happens with the sanctuaries in Pakistan, from which the Taliban are operating, because if there continues to be external support for insurgency in Afghanistan, no matter how cordial the relations between the two candidates for the presidency might be after these outcome is resolved. The military situation is still going to be a pretty desperate one. And so in that sense, diplomatic measures to address the problem of meddling by neighbouring states remains central to making progress.
SNOWDON: And Afghanistan's electoral problems might not be over. It faces parliamentary elections next year making reform an urgent priority for Afghanistan's next President -- whoever that might be.