While July has brought record numbers of UK military casualties in Afghanistan and an increasingly vociferous home-grown opposition to Britain's engagement there, Gordon Brown's government is apparently uncertain where to go next with the eight-year-old conflict which has sapped the country's economy and morale.

On July 27, the British prime minister told the nation that the first stage of the joint US-UK 'Operation Panther's Claw' to rout the Taliban in Afghanistan's Helmand province had been "successfully" completed.

On July 28, however, the UK and US made a joint statement announcing that they were now ready to talk to the Taliban - usually a tacit admission of military defeat and a prelude to troop withdrawal.

Two days later, General Sir Richard Dannat, the outgoing head of the British Army, urged ministers to send more troops to Afghanistan and adopt a "war-like footing" to defeat the Taliban.

Behind these incompatible statements lies the stark realisation that Britain's ill-equipped 9,000 troops are making little progress against a relentless insurgency.

Contained in Helmand Province, they make a relatively easy target - 22 UK soldiers were killed in the first half of the month and 57 injured.

UK and US military commanders were seemingly unprepared for the possibility of defeat, although they should not have been: even the mighty Soviet Army, with 115,000 troops on the ground at the height of its 10-year battle with the Mujahideen through the 1980s could not prevail.

The combined US-Allied forces presently number just 96,500 and the opposition is a great deal stronger.

Let us not forget that the US armed and trained the Taliban through the 1980s. They have been a fighting force for the best part of 30 years and, since the US morphed from friend to foe, have formed an alliance with Al Qaida resulting in an additional influx of battle-hardened jihadis from Iraq and the introduction of suicide bombing - a tactic the Taliban had never used before.

Several former officers from Saddam Hussain's Republican Guard also left the Iraqi insurgency to train fighters in joint Taliban/Al Qaida camps in Afghanistan and Pakistan, bringing their deadly expertise in the Improvised Explosive Devices (IEDs) we have seen used to such devastating effect against British soldiers.

The occupation forces face a further, unprecedented, threat from across the border in Pakistan where a burgeoning Taliban movement has been active since early 2002, and includes an estimated 80,000 armed fighters.

Afghan Taliban leader Mullah Omar and his military advisers are based in Quetta, Pakistan, and the core Al Qaida leadership is also rumoured to be in hiding in the tribal regions between the two countries.

Unsurprising then, that the British government is metaphorically scratching its head and wondering not only what to do next but what it is doing in Afghanistan at all.

Ministers cannot agree on this most basic question. For Tony Blair in 2001 it was about capturing Osama Bin Laden in the wake of 9/11; for UK Foreign Secretary David Miliband it is about upholding democracy; on July 8, Harriet Harman, Deputy Prime Minister, told the House of Commons that it was about "'the education of people in that country" while Brown said on July 15 that the aim of operations had been to "tackle the terrorist threat to Britain".

In the absence of clear aims, it is difficult to assess progress. Nevertheless, the war on Afghanistan has signally failed to achieve any of the serious objectives above: Bin Laden remains at large and Al Qaida is stronger and more widespread than ever; in terms of democratic progress, about two thirds of Afghanistan is effectively under Taliban control and AP reported on July 28 that at least 10 per cent of Afghanistan's 7,000 polling stations (including those in Helmand Province) will not open for the August 20 election because of security fears; with regard to Britain's internal security, the Taliban have never struck outside their own territory and there was no threat to the UK from Al Qaida prior to the 2003 invasion of Iraq.

The British public is also questioning the UK's involvement in Afghanistan, angered by widely broadcast scenes of grief in Wootton-Bassett, where the coffins of fallen soldiers have been paraded through the streets.

As the recession bites deeper, many wonder why the government is spending £4.6 billion (Dh28.24 billion) a year on its wars in Iraq and Afghanistan.

The first six months of this year has also seen an unprecedented 1,013 Afghan civilian deaths and the influential 'Stop the War' campaign is organising mass demonstrations calling for an immediate withdrawal.

A poll, published in the Independent on July 28, found that 58 per cent of Britons consider the war 'unwinnable' and 52 per cent want troops out now.

Many within the UK's military establishment itself openly oppose the war. On June 20, Major SN Miller of the Defence Intelligence Staff, writing in the British Army Review, spoke of the campaign as an "unmitigated disaster" and noted that "the Army has become defeatist with commanders openly talking about an unwinnable war".

In October 2008, Brigadier Mark Carleton-Smith, the UK's top military officer in Afghanistan, was equally outspoken, telling the Sunday Times "we're not going to win this war" [a view that was instantly backed by the head of the French military General Jean-Louis Georgelin].

In winter, the mountainous Afghan terrain will become increasingly hostile - a circumstance that favours native insurgencies (the defeat of the French army by the Algerian FLN in the mountains of Kabylia is a compelling precedent).

The need to secure a dignified exit strategy before the summer ends may well be the reason Obama and Brown want to talk to the Taliban.

Only one question remains: Will the Taliban want to talk to them?

Abdel Bari Atwan is editor of the pan-Arab newspaper Al Quds Al Arabi.