Labour has conceded for the first time that a "primitive understanding" of the Islamic world caused some of the problems faced by the west in Iraq and Afghanistan, and warned David Cameron his response to the terrorist crisis in north Africa shows he has not learned the painful lessons from those conflicts.

In a speech on Thursday, Jim Murphy, the shadow defence secretary, will suggest the Blair government did not appreciate what it was getting itself into after the September 11 attacks, as British forces joined the international effort to overthrow the Taliban and hunt down Osama bin Laden's al-Qaida network.

Murphy will stop short of saying Labour was wrong to have supported the invasions, but will say Cameron is in danger of ignoring lessons from the past in his analysis of the jihadist threat in Mali and Algeria.

In particular, he will criticise the prime minister for a speech in which he said the UK faces a "generational struggle" against Islamist-inspired terrorism in the region.

"Some of the political language applied in response to recent events has suggested a natural continuation of the 9/11 world and in turn the strategy then deployed," Murphy will say.

"The prime minister's declaration of a 'generational struggle' oversimplifies the nature of the threat and compounds rather than learns the lessons from the past."

Murphy will say it would be wrong for Downing Street to suggest there are parallels between the al-Qaida network in Afghanistan and Pakistan, and the "patchwork of loose alliances" that constitute al-Qaida in the Islamic Maghreb (AQIM).

"Al-Qaida was presented as a coherent entity. While truer in the past, it is now a looser franchise. A search for simplicity led to solutions which paid insufficient regard to the complexity of local circumstance. Today the patchwork of loose alliances which comprise the extremist threat in north and west Africa is essential to understand."

Ignorance caused many of the difficulties in Iraq and Afghanistan, Murphy will say, and now is the time to "assess lessons from recent history".

"An almost primitive understanding of the Afghan population, culture and geography prior to Nato's intervention severely undermined international attempts to work with proxies, and our political strategy was in its conception insufficiently representative."

Murphy will admit that it "took too long for us to see the training of the Afghan National Army and Afghan National Police as a strategic priority."

In Iraq, he will say, "there was a serious deficit in Western comprehension of the Sunni-Shia or intra-Shia dynamics. We know that de-Baathification left a lethal vacuum."

He will go on to say: "Mali shows neither we nor our allies have fully applied these lessons. While necessary to act, Mali is a failure in prevention and foresight. Mali has been on the critical list for a long time yet action has been rushed, with shifting objectives. Trainers should be sent to deter a crisis rather than in response to it. An internationally driven political solution is in its infancy at best."

In his speech to the Henry Jackson Society, Murphy will commit a future Labour government to retaining an interventionist defence policy, but insist this can be done without resorting to "heavy-footprint operations we do not want to repeat".

He will say: "While Iraq and Afghanistan have been painful and rightly controversial, we cannot hide from the fact that events and threats overseas may necessitate the use of military force. A belief that we have responsibility beyond our borders is not, as some would have it, ideological, but an essential response to the world in which we live. Our nation should be haunted by the isolationist reticence of Douglas Hurd over Bosnia and the tragedy we witnessed in Rwanda."

To prevent future crises, he will say, the UK needs to engage with fragile nations, invest early and offer training to build up local defences against militant groups.

Labour believes the UK should offer to set up more officer training centres abroad, based on the Royal Military Academy at Sandhurst, and ensure language training is enhanced across the British armed forces.