(Adds Karzai comments, details)
By Praveen Menon and Hamid Shalizi
KABUL, June 14 (Reuters) - Afghans headed back to the polls on Saturday for a second round of voting to elect a successor to President Hamid Karzai in a decisive test of Afghanistan's ambitions to transfer power democratically for the first time in its tumultuous history.
As most foreign troops leave by the end of 2014, whoever takes over from Karzai will inherit a troubled country with an increasingly violent Taliban insurgency and an economy crippled by corruption and the weak rule of law.
The vote pits former anti-Taliban fighter Abdullah Abdullah against ex-World Bank economist Ashraf Ghani after neither secured the 50 percent majority needed to win outright in the first round on April 5.
There were far fewer incidents of violence than had been feared, and, like in the first round of voting in April, there was a palpable sense of relief in the Afghan capital as polls closed at 4 p.m. (1130 GMT).
"Based on what I saw, it's been a very calm election day with vigilant security," Thijs Berman, the chief observer of the EU Election assessment team in Afghanistan, told Reuters after visiting some polling stations.
Twelve million voters were eligible to cast ballots at 6,365 polling centres across Afghanistan, from windswept deserts on the Iranian border to the rugged Hindu Kush mountains, with preliminary results due on July 2.
Karzai, standing down after 12 years in power, is expected to retain a hand in Afghan politics but has been tight-lipped about his plans.
"Today Afghanistan takes a step towards stability, development and peace. Come out and determine your destiny," Karzai said after casting his ballot.
"Come out and rescue your country from destruction and foreign dependence, bring stability to your country and make its future prosperous."
Voters were not put off by a couple of rockets landing in the capital and other minor explosions, in which one person was reported injured. Long queues snaked out of polling centres after voting began at 7 a.m.
Rocket attacks were also reported in eastern Ghazni province.
Two tribal elders were killed when they defied a Taliban warning in Kunar province not to participate in the elections, triggering a gun battle between the villagers and insurgents, provincial officials said. Four rockets landed in the provincial capital, but no casualties were reported.
Overall, there were 150 roadside bombs, magnet bombs and rocket attacks, according to the interior ministry.
"As in the first round, I saw very determined voters," Berman added. "Afghanistan needs a reliable outcome accepted by all stakeholders that would guarantee the peaceful transition from one president to another."
The election process has been fraught with accusations of fraud by both candidates and many fear a close outcome will make it less likely the loser will accept defeat, possibly dragging Afghanistan into a risky, protracted stand-off over the vote.
"We ask everyone to prevent and discourage people from fraud and vote-rigging so that we can have a transparent, free and fair election," Ghani said after casting his vote in West Kabul.
People have turned out in large numbers, his rival, Abdullah, told reporters. "Security is a concern but the people of Afghanistan have defied security threats so far," he said.
The Taliban are a formidable obstacle to peaceful elections. The insurgents, now at the height of their summer offensive, have warned people not to vote in an election they have condemned as a U.S.-sponsored charade.
Abdullah survived an assassination attempt on June 6, when two bombs exploded outside a Kabul hotel where he had just held a rally. Twelve people were killed.
The high turnout of nearly 60 percent in the first round was a major defeat for the Taliban but this time observers expect fewer than 5 million voters, discouraged by security concerns.
Officials in Kabul are concerned by the prospect of a close outcome that could, in the worst scenario, propel the country back into war along ethnic lines.
Both candidates set the stage for complaints, repeatedly accusing electoral organisers of incompetence and bias.
The United Nations has urged candidates not to attack the organisers, to safeguard the process.
"There's a short-term gain only in trying to undermine or bully the institutions at the expense of their legitimacy," said United Nations deputy chief Nicholas Haysom.
"It's going to be the legitimacy of the elections which will give legitimacy to the new head."
Abdullah polled 14 percentage points ahead of Ghani in the first round with 45 percent of the vote, but Ghani, who is ethnic Pashtun, stands to gain a portion of the Pashtun vote that was splintered in the first round.
Pashtuns are Afghanistan's biggest ethnic group, making up about 45 percent of the population. While Abdullah is partly Pashtun, he is identified more with the ethnic Tajik minority.
The chances of an equal split between candidates are hard to gauge because there are few reliable polls. ACSOR research centre, asking respondents to choose between Abdullah and Ghani, predicted a 50:50 split before the first round. (Additional reporting by Mirwais Harooni and Jessica Donati; Editing by Maria Golovnina and Rosalind Russell)
Our Standards: The Thomson Reuters Trust Principles.