Pakistan’s release this month of eight long-imprisoned Taliban commanders raised hopes that Afghanistan’s moribund peace talks could be restarted. In fact, the gesture, made at the request of Afghan President Hamid Karzai, said more about the attempt by Pakistan’s new government to improve relations with Afghanistan than it did about the prospects for peace.

While there is a chance for a breakthrough toward stability in Kabul in the coming months, it relies on two entirely different matters: the presidential election process just getting under way and a pending bilateral security agreement between Afghanistan and the United States.

The two are closely related, at least in the view of U.S. officials. If the security agreement can be completed by the target date at the end of October, it would give Afghans a sense of confidence as they contemplate who should replace Karzai as president following the April election.

The accord would provide for U.S. trainers and Special Forces to remain in the country after the scheduled departure of all combat troops at the end of 2014. It would give Afghans sound reason to believe that their next government would not be toppled by the Taliban. A failure to complete a security agreement, or a failed Afghan election, would be a disaster for the United States as well as for Afghanistan.

If the Obama administration can’t reach a deal with Karzai, then it should show patience, focus on promoting a free and fair election, and wait to negotiate with his successor.