Aghanistan's elections are being planned behind thick walls and high security on the outskirts of Kabul.

Inside an array of single-storey buildings, the country's Independent Election Commission (IEC) is holding daily seminars on electoral democracy with groups of teachers, village elders and civil society groups. The place hums with earnest national pride and enthusiasm for the machinery of the democratic process.

I am one of a group of European journalists flown to Afghanistan by the US state department. Along the way, the message the Obama administration wants to send is spelled out at Nato headquarters in Brussels.

"It's not getting any easier," one Nato official said. "But it's ours to lose."

The journalists on the trip are all from troop-contributing nations, all of which America is asking to send more troops or police trainers or money to help hold Afghanistan together in a critical year.

It is no accident that the IEC is the first stop on our tour. It is preparing for new presidential elections in August and its workers have just finished registering 4.5 million voters, visiting every district in the country without suffering a single casualty.

Zekria Barakzai, the deputy head of the commission, argues this extraordinary feat is explained by the IEC's softly-softly methods. Its officials do not arrive in a big cloud of dust and convoys of heavily armed men, even in the turbulent south.

"We organise security with the elders with the help of tribal leaders. We talk to them first," Barakzai said.

In the end there were 10 districts in the whole country, 195,000 out of 30 million people, that could not be registered for security reasons. In two of those districts, in Kandahar province, the IEC set up an alternative registration site, along the road from the districts to their local markets.

After talks with tribal leaders in one district, the local Taliban met the IEC officials at the edge of town, escorted them in, registered, and then provided security on their way out.

"This is a model. This is the way the government should react to realities," Barakzai said.

President Hamid Karzai and his ministers are not Barakzai's favourite people on this particular day. He has just heard that the president was about to send the IEC a letter asking for the election date to be brought forward, from August to April.

He does not try to hide his irritation. "Only the Independent Election Commission decides the date of the election, and that has already been decided," he said.

There is a political problem, however. Karzai's mandate runs out on 21 May. Last year parliament agreed to extend Karzai's term until August, to allow for better security and more preparations for the election. But it has now changed its mind.

Karzai's letter is intended to force a crisis, calling the opposition's bluff and putting pressure on the international community to back him. But there is a danger the ploy will trigger a crisis without forcing a solution, undermining faith in a government that is already wafer thin.

The US government is still working on its Afghan policy review, but there is little doubt that it will broadly represent a continuation of the strategy pursued over the last few years. The aim of that strategy is to stabilise the country sufficiently to give the government the chance to provide services and infrastructure, thus cementing Kabul's authority.

The hole in the middle of this strategy is central government: it is dysfunctional and corrupt. Karzai, with no previous experience of administration, has tried to run it from his mobile phone. As the Pakistani writer Ahmed Rashid argues in his new book on the region (depressingly titled Descent into Chaos), the president has sought to project his power through deals with a network of strong personalities, warlords mostly, rather than building enduring institutions.

The one exception is the Afghan national army, which is more than 80,000-strong and involved in 90% of the military operations around the country. But the army cannot build roads, bring electricity or teach children. That requires a functioning and energetic government.

The British and French are working on a common approach to present to Obama before the Nato summit next month that would put more emphasis on local and traditional forms of government, and less on Kabul. The Americans are reluctant to give up on Karzai.

The important thing, Barakzai says, is not to give up on Afghanistan as it attempts to emerge from three decades of warfare. Against all the centrifugal forces, ethnic and regional, pulling the country apart, there is a strong sense of common national identity and heritage.

Just as I'm leaving Barakzai's office, he runs to a cupboard and pulls out a handful of pebbles.

"Do you know what these are?" he asked. "Pebbles from Brighton beach. I took them because I heard they are the Queen's property. We shall give them back when she gives back the Koh-i-Noor [diamond]."