In December, Washington was abuzz with what, in think-tank circles, was described as a "narrative of success". The war in Iraq was finally over and US troops were leaving with their honour intact. A similar theme was evident in official talk of progress in Afghanistan.
The chairman of the US Joint Chiefs of Staff, Gen Martin Dempsey, said that military objectives had been achieved there, too. His boss, Leon Panetta, the secretary of defence, asserted that Nato was "winning" and the war had reached a "turning point". An aggressive "surge" of 33,000 US combat troops over the last two years had regained control of territory in southern and eastern Afghanistan, areas previously lost to the Taliban. The relentless after-dark pursuit of Taliban suspects by CIA-directed special forces squads, equipped with, and supported by, cutting-edge technology, had also greatly weakened the insurgents.
Nato has focused its attentions on creating an "antiterrorist bulwark" capable of keeping the Kabul government in power in the long-term. The primary goal has been to recruit, train and deploy Afghan army troops and paramilitary police in huge numbers to replace departing military units. To date, 305,000 men have been enlisted and are gradually being handed responsibility for security in both secure and contested provinces.
A second and highly controversial part of the same strategy involves the privatisation of the conflict.
The Pentagon has hired armed security contractors to perform roles such as securing Nato convoys, military facilities and areas not yet policed by the Afghan government, enabling uniformed US personnel to focus exclusively on combat and counter-terrorist operations. In addition, and to deprive the Taliban of sympathisers in rural settlements, Nato is putting together a large tribal militia force, known officially as the Afghan Local Police. Both contractors and militias are due to be replaced by a national police force when Nato troops leave at the end of 2014. However, independent security experts working in Afghanistan see the conflict through a very different prism.
Washington's narrative is aimed squarely at the American electorate as part of Barack Obama's re-election campaign, which will peak in the autumn as, conveniently, the last units associated with the surge withdraw from Afghanistan.
What the Washington story leaves out is that the objective of the surge was never to engineer the outright defeat of the Taliban. Rather, it was to deprive it of "exclusive space", strongholds where the insurgents could act as the de facto government. That tactic has been successful, but there is heated debate as to whether it has stemmed violence in Afghanistan. Nato has cited a two per cent decrease year-on-year in the number of insurgent attacks. In stark contrast, the United Nations has reported a 32 per cent increase, while other international humanitarian organisations believe that security conditions in Afghanistan are now in their worst state since 2001.
American generals and Afghan politicians alike fret that withdrawal is premature, and that the replacement forces are not capable of keeping the Taliban at bay. There is much to support this conclusion.
Training of the Afghan security forces has been substandard, they have consistently displayed a reluctance to shoot first in confrontations with the Taliban, and desertion remains commonplace.
The composition of the Afghan army is another major concern. Recruitment drives have failed to attract significant numbers of ethnic Pashtun, the largest community in the country, who demographically dominate the Taliban strongholds in the south and east of Afghanistan. Instead, the army is predominantly ethnic Tajik.
As big a concern is the US empowerment of regional strongmen, commonly referred to as "warlords", as frontline adversaries of the Taliban.
More often than not, such warlords combine the conflicting roles of senior government official, tribal militia leader and armed private security contractor, and are among the primary beneficiaries of the war economy. The warlords frequently defy the writ of Kabul, switching sides when the Taliban offers a better deal, a 2009-2010 US Congressional investigation found. Many have been implicated in Afghanistan's enormous narcotics trade, which in 2011 produced a breathtaking 5,800 tonnes of opium - a 61 per cent year-on-year increase in productivity.
Frequently, regional appointments have also benefited a particular tribe or clan, which has, in turn, abused its position to harass local rivals. Such behaviour draws dark comparison to the prevailing conditions in Afghanistan after the 1989 Soviet withdrawal - circumstances that led to the creation of the Taliban in the first place. It has added to fears of a post-Nato breakdown, in which different elements of the Afghan security force could be fighting each other for control of the drug trade as often as they combat the Taliban.
"Our training of the Afghan security forces has really sucked," according to Christine Fair, a South Asia security expert at Georgetown University, "because our only aim is to replace US troops." She offers a particularly gloomy assessment of the future: "We have completely patronised warlords. I don't know how this is going to play out in any way that isn't a complete disaster."
Audaciously, the Taliban has responded play-by-play to the Nato strategists. Having heard Obama announce the surge, the Taliban ceased confrontational military operations and began to tactically withdraw from towns and settlements.
For the last two years, the Taliban has weathered the surge, albeit with difficulty, a reality that militant sources freely admit has significantly weakened the organisation's capabilities.
Security experts believe the Taliban will regenerate because of its strong "bottom-down" command structure, which is based on conventional military forces, and its ability to recruit young foot soldiers. It has also been given time and space to recuperate by the shift of military focus to eastern Afghanistan strongholds of the Haqqani Network. Based in three provinces of eastern Afghanistan, known collectively as Loya Paktia, and the adjacent Pakistani tribal regions of North Waziristan and South Waziristan, the Haqqani Network was responsible for the slew of audacious terrorist attacks against US targets in Afghanistan in 2011. Meanwhile, insurgents in the Islamic Emirate of Mullah Mohammed Omar's southern strongholds of Helmand and Kandahar said they had not seen any major attacks by US forces since last spring, presumably because of preparations for the withdrawal of surge troops.
"The Americans have stayed in their bases for the last few months," said a Kandahar-based commander of the Harakat-ul-Mujahideen, a Pakistani militant group allied with the Taliban.
Sources in the three main Taliban factions, meanwhile, said the insurgency has been reorganised with each group sharing resources to orchestrate a campaign to undermine political objectives. Its campaign has involved the assassination of high-profile Afghan political figures and regional administrators, to stymie the creation of a sustainable government. Victims included Ahmed Wali Karzai, the half-brother of the president, who led the counterinsurgency campaign in the Taliban stronghold of Kandahar.
The Taliban's counter-counterinsurgency flows all the way down to the villages, with six-man guerrilla squads formed to mirror the six-man CIA-special forces embedded with tribal militias. That tactic also seeks to make the presence of militias synonymous with Taliban attacks, rather than a deterrent to them.
That is typical of the psychological warfare being waged by the Taliban. At the high end of the conflict, the militants have repeatedly demonstrated their ability to infiltrate Kabul's safe havens. In July and September respectively, Taliban suicide squads besieged the InterContinental Hotel and US Embassy and, in December, cheekily released copies of the security plan for a national conference of tribal leaders held to authorise a new security pact between Kabul and Washington.
These mind-games cultivate the perception among Afghans that the imminent exit of foreign forces will, sooner rather than later, lead to the complete collapse of the government.
This winter, hundreds of thousands of Pakistanis displaced by previous counter-terrorism operations in the tribal regions bordering Afghanistan, known collectively as the Fata (an administrative acronym), have been able to return home for the first time in three years.
The scale of the operations, in terms of military manpower, has exceeded even the peak US commitment in Afghanistan - 147,000 versus 101,000 -and the cost of sustaining counterinsurgency operations, involving a quarter of Pakistan's standing armed forces, has been crippling, both in human and economic terms.
Since the Tehrik-i-Taliban Pakistan (TTP) launched its militant insurgency in September 2007, about 30,000 Pakistani civilians and security personnel have been killed in terrorist attacks. When the government began to fight back in 2008, development expenditure practically skidded to a halt, as funds were diverted to support the huge military deployment in the Fata and adjacent districts.
Indeed, the return of refugees, particularly to the tribal regions of Bajaur and South Waziristan, previously the strongholds of the two largest TTP factions, is a milestone in Pakistan's war on terror.
Under intense pressure from the military, the TTP has splintered into dozens of groups and no longer functions as a unified insurgent force, militant sources and security experts said.
"The TTP is no longer an effective organisation. It is riddled with divisions," said Mansur Khan Mahsud, director of research at the Fata Research Centre, an Islamabad think-tank. "They have merely not announced a formal split, because were that to become common knowledge, the TTP would lose all credibility."
Many of the TTP factions are clan-specific and restricted to their respective tribal homelands. Some are smaller in numbers than an army company. However, those splinter groups continue to pose a serious security threat largely because peace in North Waziristan and South Waziristan is tied to agreements between the security forces and Afghanistan-focused militants.
These agreements have created a facade of relative stability in the Miranshah area of North Waziristan, where Hafiz Gul Bahadur is the dominant militant commander and key ally of the Haqqani Network. That is because they have prevented the military from taking the initiative against TTP insurgents who have, since 2009, taken refuge in the Mir Ali area. Security experts said the peaceful co-existence in North Waziristan reflected "a shared ideology with different tactics".
A similar peace accord is in force in the plains areas of South Waziristan, also with a Haqqani Network ally, Maulvi Nazir.
Residents of Wana, the main town, are happy that Nazir hasn't fired a shot in anger there for four years, but resent the restrictions he has placed on them, such as banning the wearing of colourful or patterned clothing. Raising his hand, Ali Mohammed, previously the councillor for Wana, pointed to his fingers as a means of explaining the relationship between the TTP and Afghan militants using Pakistan as a safe haven.
"The fingers look separate, but they belong to the same hand," he said.
Residents bemoan the government's reluctance to directly engage thousands of tribesmen who have been drawn into the TTP ranks by economic circumstance.
Like the Taliban factions in Afghanistan, the TTP has targeted opposing tribal elders, killing 1,500 of them, to establish its political credentials.
Security experts and Fata residents fear that any deal with the militants that does not include local tribes as the ultimate arbiter could push many of them permanently into the TTP camp, refuelling rather than extinguishing the insurgency.
The consensus among all involved in Afghanistan is that peace is possible if the weakened but resilient Taliban can be attracted to the negotiating table. But there is nothing but disagreement on the terms of engagement.
The US says it is interested in hearing what the Taliban has to say, but will continue fighting to degrade their combat capacity. It has also barred any Taliban involvement in international diplomatic efforts aimed at securing future support for the Afghan government. The administration of Hamid Karzai, the Afghan president, backs the US position, but in December moved to block a reported Qatari move to provide Taliban intermediaries with an address from which to participate in a dialogue with Nato. Kabul was angry to learn of the development second-hand and waited until January to issue a curt statement saying it supported the process, and only after the office opening was confirmed.
The Taliban says it is open to dialogue, on condition that Afghans interned without charge at Guantanamo Bay are repatriated or released into Qatari custody, and the complete exit of foreign forces. Reportedly, there have, over the last two years, been tentative meetings between Taliban intermediaries and US officials on neutral territory. But it remains unclear whether the intermediaries can in any way speak for Mullah Omar.
Pakistan supports peace talks and, in July, even arranged a meeting between US officials and representatives of the Haqqani Network. However, it turned out to be a poor example of Islamabad's ability to steer the faction, which soon after launched its most daring attacks yet on US targets in Afghanistan.
At the same time, Pakistan has embarked on indirect peace talks with the TTP, carried out through Haqqani Network interlocutors, although it claims any deal would be dependent on an unconditional surrender by those insurgents.
Pakistan is also part of an emerging strategic partnership with major Asian powers, none of which want US influence to expand in their backyard, and all of which suspect it is using Afghanistan as a staging post for covert operations. That perception was boosted in December when Iranian security forces hacked a passing CIA drone and landed it undamaged.
At a conference of regional powers in Istanbul in November, Pakistan worked with China, Russia and Iran to block a US proposal for an international Afghan border monitoring mechanism. Instead, the emergent bloc backed the Iranian position of a "regional solution to a regional crisis" - a poignant reminder that the installation of the Karzai administration in 2002 was made possible by the joint efforts of several influential governments, including Iran.
Repeatedly, officials in Kabul and Washington state that Pakistani cooperation is a prerequisite for peace in Afghanistan.
However, throughout last year, divergent interests in Afghanistan acted to turn the strategic relationship between Pakistan and the US into a transactional one in which events, rather than shared objectives, are dictating the course.
It started in February with the killing of two Pakistanis in Lahore by a CIA intelligence contractor working under diplomatic cover - part of a network built by Gen David Petraeus, the current CIA chief, while he commanded forces in Afghanistan.
It progressed to Washington's decision in May not to inform Islamabad about its operation to kill Osama bin Laden. Pakistan retaliated by asking US special forces trainers to leave the country, prompting a partial suspension of military aid.
The final straw was the assertion in September by the outgoing chairman of the US Joint Chiefs, Admiral Mike Mullen, that the Haqqani Network is a "veritable arm" of Pakistan's ISI spy agency - the clearest accusation to date by an American official that Pakistan is complicit in some Taliban attacks on Nato.
Bilateral relations appeared to thaw in October, when Hillary Clinton, the US Secretary of State, visited Islamabad for talks in which both sides acknowledged conflicting interests and the need to work through them. But that détente was brought to a screeching halt by an inadvertent Nato attack on a Pakistan military post near the Afghan border back in November.
Pakistan retaliated by suspending intelligence cooperation, closed its highways to Nato supply lorries and ordered the US to vacate a leased air force base used by drones to conduct joint operations against militants in the Fata tribal regions.
Afghanistan now awaits a renegotiation of the terms of cooperation between Pakistan and the US, although Asif Ali Zardari, the Pakistani president, has signalled a shift away from the US.
Pakistan's dissolution of its short-lived strategic partnership with the US is symbolic of the constantly diverging interests of Washington and Afghanistan's neighbour.
Meanwhile, the happy slogans of Obama's re-election campaign have prompted similar declarations by his Republican rivals for the presidency, in which the blame for Nato's woes in Afghanistan was dumped at Pakistan's door and tensions between the erstwhile allies could rise further this year if direct negotiations with representatives of Mullah Omar do not materialise. Privately, US State Department officials acknowledge they have no idea if they will.
Much will depend on circumstances controlled not by the US and Pakistan, but by the militants in the region. They could choose to be nudged and cajoled into negotiations - or they could stage further audacious attacks on US targets in Afghanistan, with the aim of provoking cross-border confrontations between Nato and Pakistani forces.
Tom Hussain is a freelance journalist based in Islamabad.