KABUL, Afghanistan — The two remaining candidates for president of Afghanistan said on Thursday that they accepted the final results of the first round of voting, which eliminated their other rivals, and they vowed to campaign hard to win the election in a runoff.

However, the timeline announced by the nation’s election commission will leave the country without a new president until late summer. Voters will cast their runoff ballots on June 14, with final results to be announced on July 22. Under Afghan election law, the new president would then be inaugurated 30 days later, officials said.

The dates matter to the United States and other Western countries, where military planners are hoping to determine as soon as possible what will happen after the current United Nations mandate for their forces in Afghanistan expires at the end of the year.

Both candidates have said they will sign the bilateral security agreement that has already been negotiated with the United States, and which provides for the continuing presence of American troops. The current president, Hamid Karzai, has refused to sign it before he leaves office, leaving the matter to his successor.