Abdullah Abdullah, who emerged as the front-runner with 45 percent of the vote in the first round, faced Ashraf Ghani Ahmadzai, an ex-World Bank official and finance minister. Neither garnered the majority needed to win outright, but previous candidates and their supporters have since offered endorsements to each, making the final outcome unpredictable.
The two men differ more in personality than policy. Both promise to sign a long-delayed security pact with the United States. That would allow nearly 10,000 American troops to remain in the country for two more years to conduct counterterrorism operations and continue training and advising the ill-prepared Afghan army and police. And both pledge to fight for peace and against corruption.
But their different ethnic backgrounds have highlighted the tribal fault lines in this country of 30 million ravaged by decades of war.
"I voted today for my future, because it is still not clear — the country is at war and corruption is everywhere and security is terrible. I want the next president to bring security above all and jobs," said Marya Nazami, who voted for Ahmadzai.
The White House praised Afghan voters for their "courage and resolve" in the second round.
"These elections are a significant step forward on Afghanistan's democratic path," it said in a statement. "We look forward to working with the next government chosen by the Afghan people."
The Taliban intensified attacks ahead of voting and warned people to stay away from the polls, but the Islamic militants failed to disrupt the first round. They stepped up attacks again ahead of this round, including an assassination attempt that narrowly missed Abdullah just over a week ago.
Many voters said they were eager to get the bilateral security agreement with the United States signed after seeing Islamic extremists seize large sections of Iraq in recent days, nearly three years after U.S. troops withdrew from that country. Outgoing President Hamid Karzai, who has grown increasingly alienated with the U.S. during his two terms in office, had refused to sign the deal.
Iraq's Shiite-led government had discussed the possibility of a residual U.S. force but the two sides were unable to reach an agreement.
"Iraq is burning," said shopkeeper Abbas Razaye after voting in a mosque in western Kabul. "We need the foreign troops for the time being. Otherwise our history of civil war will repeat itself and Afghanistan will deteriorate even more than Iraq."
Voter Sayed Qayyum agreed the pact should be signed. "I am afraid if it isn't signed then Afghanistan will face the same fate as Iraq," he said.
Abdullah, 53, whose mother was a Tajik, draws his support mainly from that ethnic group although his father was Pashtun. During the Soviet occupation of Afghanistan, he served as adviser to and spokesman for Tajik warlord Ahmad Shah Massoud, who was assassinated by al-Qaida two days before the Sept. 11, 2001, attacks.
Later that year, Abdullah became the face of Afghanistan's anti-Taliban movement after the U.S. toppled the Taliban government, giving frequent news conferences to international journalists. He served as foreign minister and then was the runner-up in Karzai's disputed re-election in 2009.
His supporters praise him for staying in the country during the civil war and fighting the Taliban, as opposed to Ahmadzai who lived in exile and at one point even had U.S. citizenship, which he gave up for his own failed bid against Karzai five years ago.
"Abdullah was always among the Afghans inside Afghanistan," said restaurant owner Mohammad Nahim, who cast his ballot in western Kabul. "Abdullah can bring peace and improve the economy."
Ahmadzai, a 64-year-old, U.S.-educated Pashtun, has gained the support of the country's largest ethnic group, particularly in the Taliban heartland in southern Afghanistan.