The way Britain went to war in Iraq and Afghanistan was incoherent, inconsistent, and opaque, with political leaders failing to face up to military commanders, according to a study by a leading thinktank released on Thursday.

The report, published by Chatham House, challenges the view that politicians, notably Tony Blair and Gordon Brown, should bear the sole blame for Britain's military failures. Drawing on recent evidence, including from the Chilcot inquiry, it concludes that Britain suffered a wider failure of government, with politicians, senior military officers and civil servants all playing a part.

"The overall impression of British practice was of disorder and incoherence, informality and individuality", said James de Waal, the report's author. The British governmental machine was simply unsuited to the enormous challenges and pressures of the conflicts in Iraq and Afghanistan, he suggests.

There was no clear idea of the roles of ministers, senior military officers, and civil servants and how they should work together. "All interpreted their roles in different ways, with effectiveness depending on the quality of individuals and the personal relationships between them", says the report, titled "Depending on the Right People: British Political-Military Relations 2001-2010".

It says that ministers, including Blair and Brown, gave military commanders a free hand but were also deeply concerned about the close relations between senior military figures and the media. That helps to explain how decisions about defence policy, and also military tactics, were made. "The battles are fought as much in Fleet Street as in Iraq or Afghanistan', says de Waal.

Britain contributed thousands of ground troops to the invasion of Iraq rather than just air strikes and limited numbers of special forces as ministers suggested, as a result of presssure from the army, he argues.

In 2009, Brown's Downing Street was not convinced of the military need to send reinforcements to Afghanistan but agreed to do so because it wanted to prevent hostile press briefings by the military, the Chatham House report says.

However, British officers have told the Guardian that one of the problems was that military commanders did not "tell truth to power". They say generals and brigadiers were reluctant to demand more resources, including equipment, out of concern that ministers would accuse them of not wanting to participate at all in military operations.

The Ministry of Defence has blocked the publication of "lessons learned" essays by senior serving officers, including General Sir Nick Houghton, chief of the defence staff, and General Sir Richard Shirreff, Nato's deputy supreme allied commander.

Thursday's report argues that in order to avoid the confusion surrounding political-military relations over the past decade, the government should make decisions on the use of force subject to a formal code, approved by parliament.

The code would define the process through which decisions on the use of force are taken, and the roles and responsibilities of those involved.