Kabul: Millions of Afghans went to the polls on Thursday, defying Taliban threats of violence and sporadic attacks across the country to choose a president in the midst of a worsening war.

Two Taliban insurgents were killed in a gunbattle in the capital and rockets fell on several towns, mainly in the south and east. But the United Nations (UN) said that there were also encouraging signs of high turnout in many areas.

“The vast majority of polling stations have been able to open and have received voting materials," said Aleem Siddique, spokesman for the UN mission in Kabul.

“We are seeing queues forming at polling stations in the north, also in the capital, as well as, encouragingly, in the east," Siddique said.

President Hamid Karzai cast his ballot under tight security at a high school near his presidential palace in Kabul. He told reporters it would be in the nation’s interest if the election was decided in a single round.

He faces an unexpectedly strong challenge from former foreign minister Abdullah Abdullah. Polls suggest Karzai may not get enough votes to avoid a second round run-off, likely in October. Preliminary results are not expected for at least two weeks.

The election is also a test for US President Barack Obama, who has ordered a massive troop build-up this year as part of a strategy to reverse Taliban gains.

Obama’s envoy for the region, Richard Holbrooke, toured polling stations in Kabul and said that the voting he’d seen was open and honest. “So far every prediction of disaster turned out to be wrong," Holbrooke said.

Kabul shootout

As he spoke, two Taliban fighters were engaged in a shootout with Afghan forces in the capital. Abdullah Uruzgani, a police battalion commander, said that the two were later killed. A Reuters team was allowed inside to film their bodies.

Attacks have increased in the run-up to the poll, with fighters mounting two big suicide car-bomb strikes and a building siege inside the normally secure capital in the past week.

In a series of statements before the election, Taliban fighters claimed they had infiltrated the capital with 20 suicide bombers and would close all the country’s roads.

Concern over turnout has especially focused on southern areas, the Taliban’s stronghold and also the core of Karzai’s support. The president’s half brother, Ahmad Wali Karzai, provincial council chief in the southern province of Kandahar, said that people were turning out briskly in spite of threats.

“A rocket landed close to my house, killing a little boy and injuring his mother seriously," he said on telephone. “But despite all these warnings, people don’t listen to the Taliban. Kandahar people are used to war," he said.

Bill Gallery, senior programme director for Democracy International, a group monitoring the poll, said some of its observers in the south were surprised at how many people were turning out. It exceeded their expectations. But he added that it was too early to draw full conclusions about participation.

Many Afghans said attacks would not keep them from voting.

“The Afghan people are used to living under the worst circumstances of insecurity and fighting, why should they be afraid to come out and vote?" said Sayed Mustafa, a Kabul student, showing an ink-stained finger showing he had voted.

In northern Baghlan province, Taliban guerrillas attacked a police post, killing a district police chief.

Rockets hit the cities of Kandahar, Lashkar Gah, Ghazni and Kunduz, where two election observers were wounded at a polling station. A police official informed that in the eastern city of Gardez, two suicide bombers on motorcycles blew themselves up but caused no casualties.

More than 30,000 US troops have arrived in Afghanistan this year, raising the size of the international force above 100,000 for the first time, including 63,000 Americans.

US General Stanley McChrystal, commander of US and NATO forces in Afghanistan, could ask for more troops when he issues a report next week. “The situation is serious and we need to turn the momentum of the enemy, but we can do that," he told BBC.

A new poll in the Washington Post found 51% of Americans believe the war is not worth fighting, and only a quarter favour sending more troops.

The Afghan government has requested international and domestic media not report violence on polling day, a ban that the UN says it has asked authorities to lift.