TECTONIC plates are shifting in Afghanistan as the country nervously prepares itself for three big transitions, all related. The first, the one best known outside Afghanistan, is a security transition. Towards the end of next year Afghan troops will take over responsibility from the NATO-led International Security Assistance Force, better known as ISAF, for fighting the insurgency that has raged since the Taliban were ousted in 2001. By the end of 2014 ISAF combat troops will leave altogether.

The second is an economic transition as the country tries to adapt to a rapid fall in the foreign military presence and the aid that has accompanied it. ISAF’s huge logistical tail and its legions of high-paying contractors have dominated the economy. The transition will be most keenly felt in the big cities, where populations have soared in recent years.

Third, and no less important than the other two, is a political transition. Presidential elections are to take place in early 2014 and parliamentary elections the following year. Hamid Karzai, Afghanistan’s president since 2004, is constitutionally barred from running for a third term. Yet his decisions over the next few months will have a major impact on whether the election for his successor is as riddled by fraud as the one in 2009—or whether Afghans will be given the chance to elect a more or less representative government.

In some ways the security transition is the easy bit. An assumption has taken hold in many of the nations supplying forces to ISAF, not least in America, that the military mission has failed. Some even say that after 2014 either the Taliban will sweep back to power or the country will descend into civil war. However, while the insurgency is far from defeated and the natural tendency of generals is to be upbeat, the transition is having some success.

In the first place, the target of recruiting 350,000 men into the Afghan National Security Forces (ANSF) has been met. Despite high levels of army attrition (27% this year against a goal of 17%), it seems likely that soldiers and police will all have been trained, equipped and deployed by the end of 2013. And though a rash of “insider attacks” has damaged trust between the ANSF and their foreign mentors, joint patrols, crucial to training, have resumed, albeit with some additional safeguards.

The Afghan army is reckoned still to be a mixed bag in terms of its capabilities. Without ISAF’s help, logistics would be a mess, prey to corrupt senior officers selling off supplies. Soldiers’ welfare is neglected: poor food and lack of leave are causes of the high incidence of desertions and absences without leave. On the other hand, in operational terms the Afghans work well at the tactical level, and NCOs, the backbone of any army, are improving. The Afghan army is said to be fighting in nine-tenths of all operations and leading nearly half of them, taking four or five times the casualties of ISAF.

The army’s biggest worry is whether it will still get close air support from the Americans after 2014. That, says an Afghan NCO posted in Maiwand district of Kandahar in the south, is what Afghan soldiers need most. When attacked by insurgents while patrolling with Americans, he says, the Americans quickly call in airstrikes, and the battle is over. “But where we are, 70% of the Americans have already left.”

For the government to function after 2014, providing the most basic services the country needs, the ANSF must be able to play its role. Three things will prove critical. The first is that the West does not backslide over paying for the Afghan army and police. Their overall funding has been set at $4.1 billion a year for a slightly smaller force than the current one, with $3.6 billion provided by foreign donors. Second, the Americans and the Afghans must quickly reach a bilateral security deal. The expectation is that America will keep up to 20,000 forces in the country to train the ANSF and assist it with logistics, air support, medical evacuation and intelligence. America also sees its continued presence as an insurance against al-Qaeda regrouping in the country.

The Afghans must do their bit too, by continuing to give legal immunity to foreign troops after the current “status of forces” agreement lapses. Mr Karzai may prevaricate, but Afghan political leaders have no intention of going the same way as Iraq, where the withdrawal of immunity triggered the exit of American forces.

The third requirement is that the Afghans must have the weapons they need to fight the Taliban. That does not mean the most sophisticated Western equipment, but enough heavy weapons and aircraft to be effective. Compared with the countless billions that have been spent on the ISAF mission, the money needed to keep the ANSF going as a credible outfit after 2014 is not great. Afghans and foreign diplomats note that it was after Soviet funding for the Afghan army ended that the government fell in 1992 and Kabul was ravaged.

Some confidence in the security transition, and a belief that Western governments will not abandon Afghanistan after 2014, is a necessary but not a sufficient condition for a more or less successful political transition. Foreigners can help, but most of the responsibility lies with Afghans. A report published this month by the International Crisis Group, a Brussels-based NGO, described the road to the 2014 elections as long and hard. “In the current environment”, the report said, “prospects for clean elections and a smooth transition are slim. The electoral process is mired in bureaucratic confusion, institutional duplication and political machinations…There are alarming signs Karzai hopes to stack the deck for a favoured proxy.”

The critical tone of the report caused some indignation in Kabul, but it served a useful purpose. It reminded Afghan power brokers, Mr Karzai above all, that an attempt at cleanish elections could help forge some national consensus. And it reminded them that time is running out. If nothing is done, then the $16 billion in aid promised at a big donor conference in Tokyo in July will be in jeopardy, setting in train a slide towards state collapse.

The importance of what is at stake has not escaped the country’s politicians. Mr Karzai has promised that he will neither stand again nor encourage one of his brothers to run. However, he retains great power over the electoral process, and is probably torn between wanting to secure an honourable legacy as an Afghan nationalist and protecting his own interests and those of his clan after 2014. Fears about Mr Karzai’s intentions prompted an unprecedented declaration last week by 40 political parties and 17 civil-society groups about the principles which should underpin the election.

The declaration called for immediately setting a date for the election; an electoral-reform act to encourage the formation of effective parties (a draft bill is currently held up in the upper house of parliament, controlled by Mr Karzai); a strong legislative basis for a more accountable Independent Electoral Commission (the current IEC is appointed by Mr Karzai); a strengthened and permanent Electoral Complaints Commission (which Mr Karzai has rejected); a method of vetting candidates with links to illegal or armed groups; and a new register of voters based on a nationwide electronic ID system. It is questionable whether the $100m project to create such a system could be completed in time for the 2014 election. Yet a start could be made, and foreign-aid donors would back it. The declaration also called for ISAF and the ANSF to start planning the security measures needed to minimise voter intimidation, a big problem in Pushtun areas where the Taliban is most active.

A less tainted presidential election than the last would serve two other purposes. It might, first, pressure the Taliban to enter into political negotiations. Little on that front is happening at present. The Taliban say they are willing to talk to the Americans, who insist that any reconciliation process must be Afghan-led; to which the Taliban reply that Mr Karzai’s government is an illegitimate interlocutor. If they faced a government with some sort of popular mandate, and if the Americans had moved to the sidelines, the Taliban might have to think again.

The pinch looms

Second, a cleaner election should boost the economy. A degree of political stability would encourage investment by entrepreneurial Afghans, as well as by foreign companies looking at Afghanistan’s huge, untapped mineral wealth. A boost will be sorely needed. The high growth rates Afghanistan has enjoyed in recent years owe almost everything to international aid and the spending that supported over 130,000 foreign soldiers. ISAF’s civil arm, the provincial reconstruction teams, are already pulling out.