I had been in combat for 14 months, and I had never seen a neighborhood like Dora. Raw sewage filled the streets to a depth of two to three feet. Children waded knee-deep through the rank water to get groceries while bombs detonated around us, blasting our 20-ton Strykers several feet into the air. It was a true war zone, filled with enemy fighters who had no regard for civilian casualties.

And it could have been prevented.

Dora, Iraq, never had a consistent American presence. The Sunni Arab neighborhood in the heart of Baghdad was completely dominated by al-Qaida. My unit, part of the Third Stryker Brigade Combat Team, suffered incredible casualties while establishing control over the neighborhood. And for a group that has already been away from home for over a year, those casualties were particularly tough to bear.

Two-hundred thirty-three American soldiers were killed or wounded in Dora between Jan. 1, 2007, and Aug. 23, 2007. Third Brigade assumed responsibility for Dora in June of 2007. Over the previous 60 days there had been about 90 roadside bombs in our small area of operations. After we established a constant presence there were only two bombings during the next 90 days.

Children in Dora, a Baghdad neighborhood controlled by insurgents until an operation by 3/2 SBCT in 2007, walk through streets filled with sewage. Buried insurgent bombs destroyed the sewage system.

The war in Iraq has been a giant shell game. As units move from city to city the insurgents move too. When the first battle of Fallujah took place, many of the insurgents moved to Mosul, where attacks skyrocketed. When the Army moved forces to Mosul attacks dropped off there and spiked in Fallujah and Ramadi.

After the second battle of Fallujah and the announcement of the surge, insurgents flocked to northern Iraq, away from the reshuffled troop concentrations in the center of the country. Attacks in Mosul skyrocketed from eight per day to 40 to 50 just weeks after the Third Stryker Brigade Combat Team left Mosul for Baghdad in late 2006. Baqubah, the capital of Diyala province, spiraled so far out of control that militants staged a parade through the city center that lasted for several hours. Maj. Gen. Benjamin Mixon, the commander of the sector of Iraq that encompasses Mosul and Baqubah, recognized the insurgent movement and requested immediate reinforcements.

Gen. Mixon had to wait. There simply weren’t enough troops; all the available ones had to help stabilize Baghdad before Gen. Petraeus would allow Mixon additional resources. The insurgents used this time to lay their traps. Baqubah was a relatively stable city prior to the American surge that re-oriented the focus on Baghdad and Anbar province. Diyala province had been largely turned over to the Iraqi Army in late 2005 as American units were shifted to join the fight in Anbar province. Almost immediately, the situation began to deteriorate. Iraqi soldiers lacked the competence or motivation to maintain order, and the American advisers who remained were too few to deter an inflow of militants.

The Islamic State of Iraq, an al-Qaida umbrella group, declared Baqubah the capital of an Islamic caliphate. Following a pattern of intimidation and coercive governance, militants created shariah courts that imposed death penalties for innocuous violations like barbers shaving men’s beards. For smoking a cigarette, the offender forfeited his index and middle fingers. And while these militants brutalized the population, the insurgents entrenched. They prepared for the inevitable American assault, burying huge bombs underneath the roads and wiring houses with explosives.

The Army launched an offensive and took the city, but the attacking units paid a terrible price in blood. Casualties were horrific. The men and women in those units set the conditions for Iraqi reconciliation by stabilizing the security environment. Today, however, their hard-earned victories have been given away.

The surge is only a success if the stabilized security situation it helped to create results in fundamental compromise on issues like oil revenues, political questions related to regional governance and a plan for integrating sectarian militias into the national security forces. This has not happened. And the surge is often given too much credit in the media.

Increased troop levels gave the military greater freedom to target the insurgency, yet many positive developments in Iraq were not related to the surge. For example, sectarian death squads had largely cleansed most of Baghdad’s neighborhoods of mixed families prior to the surge; as neighborhoods divided along ethnic lines, the latent tension within Iraqi society faded.

Comparing current levels of violence to previous levels, therefore, is a fallacy. The country is fundamentally different. A new ethnic equilibrium was reached in 2007 that would have reduced violence without the surge.

Simultaneously, al-Qaida committed a crucial error that tipped the strategic balance in America’s favor. Sunni Iraqis had long chafed under al-Qaida’s brutal rule and were reaching their breaking point. When al-Qaida militants killed a prominent sheikh in August 2006 and failed to return his body for burial in accordance with Islamic tradition, the Sunni tribes shifted their loyalty to the Americans.

Gen. Petraeus’ surge strategy adroitly exploited the fragmentation within the Sunni insurgent base in the short term. Leveraging al-Qaida’s sudden weakness against America’s newfound strength, Petraeus took the fight to the insurgency with newfound vigor. With al-Qaida the primary target, American and Iraqi troops captured thousands of insurgents over the next few months and violence plummeted. Increased troop levels augmented with nearly 100,000 Sunni fighters committed to helping the Americans, offensives that captured scores of insurgents and the intangible signal that the surge sent as a sign of America’s commitment to winning were all instrumental in turning the tide in Iraq.

Today, these variables are unwinding. Petraeus’ decision to arm the Sons of Iraq and form a sectarian militia may prove to be seriously flawed. Budget problems arising from low global oil prices have exacerbated the politically charged issue of integrating former Sunni insurgents into the national security forces. A report on “Measuring Stability and Security in Iraq” presented to Congress in March noted that Sunnis “remain doubtful of the GoI’s long-term commitment to the Sons of Iraq (SoI) transition program and the implementation of the Amnesty and Accountability and Justice Laws.” Each day that passes without progress toward integrating the Sons of Iraq will wear down the patience of the Sunni community and increase the chances of renewed sectarian conflict. Recent prisoner releases have compounded this problem.

Under the Security Forces Agreement that went into effect at the beginning of this year, Iraqi judges were given the power to release detainees. Previously, American commanders had the authority to keep insurgents detained, even if Iraqi judges dismissed the case. Tens of thousands of prisoners whose cases were thrown out by Iraqi judges but who remained in jail because of American commanders’ decisions have been released.

The data on prisoner releases and roadside bombs are clear and direct. Bombings increase sharply after major prisoner releases. Even if the recidivism rate is low, a car bomb that kills 200 people requires a very limited amount of personnel to construct. Militants who directly attacked American troops have been released and subsequently detained while participating in further attacks on American forces and Iraqi civilians. I know from experience that this is not atypical.

The detention network suffers from structural deficiencies. Iraq’s prison network is an informal training ground because prisoners are not segregated. Bomb makers can share techniques on how to build explosives and expand their repertoire. Militants can exchange information and gain contacts. Petty criminals are co-opted by hardcore jihadists. American guards at camps have watched captured mortar teams teach classes on mortar operations to their untrained fellow prisoners in full view of the guard towers.

Capt. Blake Hall questioning an Iraqi man during a raid in Baghdad.

All of these facts beg the question, “Why?” Why release thousands of insurgents when a nascent country with a history of sectarian violence has not reached political compromise on the issues that motivate the sects to kill each other? Why throw away the hard-earned gains of our soldiers for no clear benefit? Why increase the chance of a religious site being bombed and potential regional destabilization?

Victory in Iraq was at hand. A critical majority of the insurgency had been captured. But the Iraqis, with tacit American approval, ceded the upper hand to the insurgents with massive prisoner releases. A two-year timeout does not deter these fanatic militants from killing hundreds of people. It should be nauseating to all Americans that militants who have attacked and killed Americans are turned free so quickly.

Under the current proposal from the Obama administration, thousands of American troops will leave the country over the coming months. Iraqis are understandably nervous about this development. As hardcore insurgents are released and American troop levels decline, the two main variables that drove the success of the surge are now working the other way.

Using previous experience in Iraq as a model for the way forward the pattern is clear. Premature troop withdrawals and security transfers in the cities of Mosul and Baqubah resulted in rapid security breakdowns that revealed the inadequacy of the Iraqi Army without their American counterparts.

Petraeus’ surge was a step in the right direction, but he had to make severe compromises–like abandoning the north and arming the Sunnis–to achieve a temporary semblance of stability. When you roll the dice you need to execute perfectly. The prisoner releases are the critical mistake that will prevent America from claiming victory.

The truth is there have never been enough troops on the ground. Gen. Shinseki and Secretary of State Powell insisted on troop levels exceeding 300,000 for any invasion of Iraq. Their expert opinions were ignored by the executive branch. American soldiers entered combat without adequate planning, and the sacred trust between those who declare wars and those who fight them was breached.

The thunderheads of a violent storm are forming on the horizon in Iraq. The withdrawal of American soldiers and the release of thousands of militants will unravel the hard work of the coalition over the last six years. When that happens, the Obama administration will be hard-pressed to choose between Afghanistan and Iraq. The decision will require trading off the symbolic importance of Afghanistan and the security of Pakistan’s nuclear stockpiles against the strategic ramifications of Iraq’s oil reserves falling under the sway of an Iranian or al-Qaida backed regime. The Army is too small and too tired to do both.

Blake Hall is a former Army captain and a member of the elite Army Rangers. He led a scout platoon in Iraq from July 2006 to September 2007. Blake’s military awards include two bronze stars with one “v” device for valor in combat. Currently, he is studying for a master’s degree in business administration at Harvard Business School.