A former Labour foreign office minister has called for the phased withdrawal of the "great majority" of British troops from Afghanistan.

Kim Howells, who had ministerial responsibility for Afghanistan until 2008 and is now chairman of the intelligence and security committee, said that the money should be diverted to securing the UK from terrorist attack.

Writing in the Guardian in a personal capacity, Howells - who supported the war in 2001 - said: "It would be better to bring home the great majority of our fighting men and women and concentrate on using the money saved to secure our own borders, gather intelligence on terrorist activities inside Britain, expand our intelligence operations abroad."

The Labour MP for Pontypridd said that the war may not be the most effective way of preventing "Islamic terrorist murders in the UK".

Controversially, he said that this "Fortress Britain" strategy would result in "more intrusive surveillance in certain communities", accepting that British Muslims would be subject to racial profiling by police and intelligence services.

"Perhaps, like me, they are considering that there might be more effective alternatives to the deployment and wondering why there has been little discussion about them, save for the usual 'if we are nice to violent jihadists they might be nice to us' variety," he wrote.

Specifically, he calls for an expansion of UK intelligence operations abroad, more police officers, more spending on anti-terrorism propaganda, and a re-examination of laws allowing free travel within the EU.

He said: "It is time to ask whether the fight against those who are intent on murdering British citizens might better be served by diverting [the cost of maintaining British forces in Afghanistan] to the work of the UK Border Agency and our police and intelligence services."

Howells said that a properly planned, phased withdrawal of troops from Helmand province - where the majority of UK forces are based - was necessary, and that the opportunity given to the Afghan people to tackle their problems has "largely been squandered".

Support for withdrawal from Afghanistan has previously been confined to the left of the party. However, Howells was a strong supporter of the war during his time as foreign affairs minister between 2005 and 2008.

An Ministry of Defence spokesman said that the war in Afghanistan was vital to ensure the states' security, adding: "Britain's own security is at risk if we again allow Afghanistan to become a safe haven for terrorists."

Howells attack comes as the MoD confirmed that five British soldiers were killed and several others injured in a gun attack by a "rogue" Afghan policeman in Helmand province..