LONDON, England — David Petraeus, the former commander of coalition forces in Iraq, has issued a stark warning to those advocating U.S. military intervention against ISIS militias bearing down on Baghdad.

The architect of the successful “surge” strategy that helped to quell the last great outbreak of sectarian violence in Iraq almost a decade ago said there was a great risk that the U.S. would be seen as picking sides in a religious battle that has been waged for generations.

The former head of the CIA and one of the most highly respected generals in modern U.S. warfare said it was only wise to offer military support if the political conditions were exactly right in Iraq, a scenario that is virtually impossible to imagine in the near-future. “This cannot be the United States being the air force for Shia militias, or a Shia on Sunni Arab fight,” he said.

Petraeus said the only way the U.S. could intervene without further destabilizing Iraq would be if the Shia-led government in Baghdad was seen as fair and representative throughout Iraq.

“If America is to support then it would be in support of a government against extremists rather than one side of what could be a sectarian civil war,” he said at the Margaret Thatcher Conference on Liberty in London. “It has to be a fight of all of Iraq against extremists, who happen to be Sunni Arabs, but extremists that are wreaking havoc on a country."

Although Petraeus was careful not dismiss the idea of airstrikes entirely, he made it clear that his pre-conditions for support could not be met by the current government of Prime Minister Nouri al-Maliki.

“The surge in Iraq, the surge that mattered most was not the surge in forces it was the surge of ideas that changed our strategy,” he said. “You cannot have 18 to 20 percent of the population feeling disenfranchised; feeling that it has no stake in the success of the country, in fact it has a stake in the failure of Iraq. Of course we reached out to the Sunni Arabs.”

He said there was a chance in the post-surge environment for Iraq to avoid this kind of bitter sectarian warfare but it was allowed to slip away. “[Iraq] really had an enormous opportunity back in 2011, it has made progress in certain areas but has not capitalized on that opportunity in the way that we had all hoped that they would,” he said.

The United States helped to set up a series of initiatives designed to co-opt the Sunni community, but many of them were allowed to wither under Maliki. “Unfortunately those agreements have been undermined by sectarian actions, going after Sunni Arab political figures and so forth, and the failure to continue to pay salaries to certain individuals and the quite harsh treatment of demonstrators in the wake of some of the actions that led to protest so there has to be a huge idea here.

“If there is to be support for Iraq it has to be support for a government of Iraq that is a government of all the people that is representative of and responsive to all elements of Iraq,” he said.