The most profound legacy of the American intervention in Iraq may be the way it changed the U.S. military’s understanding of war.

President Obama promised Friday that U.S. troops will have vacated the country by Christmas, effectively ending an occupation that claimed more than 4,400 American lives and stretched for nine years.

The Iraq war has long been plagued by its contradictions. It toppled a hostile dictator, but many Americans remain troubled that the conflict was launched on what proved to be the false contention that the country was developing weapons of mass destruction. Even within the U.S. military, there is no broad agreement that the war’s outcome should be judged a victory.

The 2003 attack on Baghdad was premised on the idea that overwhelming American firepower could do extraordinary things. Precision bombs and American tanks, linked by new information technology, could liberate a country with little risk to U.S. forces.

With a little help from American troops and civilians, a new democracy could take root.

“Iraq reintroduced us to the ugliness of war,” said Matt Sherman, who spent three years in Iraq as a civilian adviser to the U.S. military. “And maybe that is a good thing, so we don’t go down that path so easily again.”

Today, American soldiers and Marines parse their experiences in Iraq finely. When they talk about Iraq, they rarely refer to a single war. Individual tours are seen as separate conflicts, each with its own lessons, victories and defeats.

The disparate experiences have triggered a roiling debate over precisely what lessons the American military should take from the different phases of the conflict as it attempts to recast itself for future wars.

Col. Gian Gentile led a U.S. cavalry squadron in western Baghdad during some of the war’s bleakest days in 2006. “I saw terrible things,” he said, describing an experience that was common and deeply affecting for commanders. “I had five soldiers killed and had 15 with life-changing wounds.”

He returned to the United States shortly before Gen. David H. Petraeus, guided by the new counterinsurgency doctrine that he had helped write, arrived in Iraq for his third combat tour. Petraeus’s counterinsurgency approach promised to turn the old American way of war on its head.

Instead of hammering the enemy, his new doctrine urged commanders to focus on protecting the Iraqi people and persuading them to support the Iraqi government. The core of the influential document was a series of Zen-like precepts.

“Some of the best weapons for counterinsurgency do not shoot,” the counterinsurgency manual counseled.

“Sometimes doing nothing is the best reaction,” it cautioned.

From the moment Gentile read it, he doubted its utility. “It was telling me that if I would have treated the population differently in Baghdad then the outcome would have been different,” he said.

As violence in Baghdad dropped, U.S. military officers and politicians began proclaiming the success of the new approach. Gentile, who teaches history at the U.S. Military Academy, became one of the Army’s most strident heretics.

The intense, tactical focus on securing Iraqi neighborhoods in accordance with the new doctrine had prevented the U.S. military from asking big strategic questions about the war’s utility, Gentile argued.

“I hope we are going to start asking some of the hard questions now,” he said. “What have the last eight years really gotten us? What has military force really accomplished in Iraq?”

Retired Lt. Col. Doug Ollivant helped build and then implement Petraeus’s plan to protect Baghdad in 2007. The approach Ollivant advocated was drawn directly from the counterinsurgency doctrine that so disturbed Gentile.

U.S. battalions and companies moved into small, neighborhood outposts that they shared with Iraqi police and Army units. Ollivant and his immediate commanders put the outposts on sectarian fault lines. The goal was to make it harder for warring Sunni and Shiite Muslims to kill each other.

During the first few months of the new strategy, American and Iraqi deaths spiked as insurgents focused their firepower on the newly vulnerable Americans. Then violence began to fall precipitously. The conclusion that swept through the Army in 2008 and 2009 was that Petraeus’s doctrine and leadership had reversed the course of the war.

Three years after his Iraq tour, Ollivant has no doubt that the U.S. military’s counterinsurgency approach helped spur changes in Baghdad. But he has come to doubt that U.S. troops were the primary force behind the relative stability that swept through Iraq in 2007 and 2008.

Ollivant has argued that the Iraqis may have solved their own problems.

“The fundamental truth of the Iraqi settlement is that the sectarian civil war ended — and the Sunni lost,” he wrote recently in a paper for the New America Foundation, a Washington think tank. “Upon realizing this defeat, the Sunni went into damage control mode to reach a settlement.”

Lt. Gen. Mike Oates, who served three tours in Iraq, commanded more than 25,000 troops in a violent region just south of Baghdad in 2007 and 2008. During that time he and his fellow commanders enlisted, trained and paid tens of thousands of Sunnis, many of them former insurgents, to serve in local neighborhood protection forces.

The defections were the “big inflection point” of the war, he said. Oates, who is now retired, said he and many other military commanders had advocated unsuccessfully for a similar outreach effort to Sunni insurgents during earlier tours.

Their efforts to enlist the cooperation of former enemies were routinely blocked, he said.

Still, Oates doubted whether a similar approach earlier in the war would have produced the same results.

“Iraq is like a giant Jenga puzzle,” he said. “Moving one small piece has an effect on it all. We have to be very careful that we don’t exaggerate one person’s view or one set of lessons, because we will miss important things.”

These days, as the wars in Iraq and Afghanistan wind down, the Obama administration and the U.S. military are shifting to a new way of fighting. Instead of tens of thousands of soldiers policing neighborhoods and cajoling tribal leaders over cups of tea, the military is increasingly employing aerial drones and proxy forces, buttressed by small teams of special operations troops.

The goal is not to eliminate terrorism threats or the conditions that give rise to them — an approach that is seen as too costly and time consuming. Today the goal is to manage the terrorist threats in places such as Yemen, Pakistan and Somalia.

Such an approach recognizes that a certain degree of “chronic low-level threat” will remain and that “absolute security is unattainable,” said Stephen Biddle, a senior fellow at the Council on Foreign Relations.

In Iraq, the U.S. military is leaving behind a country that remains violent, especially for Iraqis who worked closely with U.S. forces.

One Iraqi, a former military interpreter, expressed his conflicted feelings about the United States over Cokes and cigarettes in Baghdad on Saturday night. The 50-year-old set his glasses on his bald head, eyes welling with tears, as he tried to reconcile his affection for the United States and its soldiers with his frustration over the country’s apparent ingratitude.

The man — who says he would be killed by Shiite militiamen or al-Qaeda in Iraq if he were identified — worked with the U.S. Army for four years in three locations. He faced rocket attacks and suspicious neighbors. He became close friends with American soldiers. He received certificates of appreciation and letters of commendation from U.S. officers, who praised him as “dependable” and “fearless.”

In June 2010, he applied for a visa and relocation through the U.S. office of the International Organization for Migration. Two months ago, he received a letter saying that he was on the waiting list for a first interview.

There are no guarantees that the grindingly slow process will result in a U.S. visa.

“You do a good job for someone and what do you expect?” he said. “You expect them to do a good job for you.”

Staff writer Dan Zak in Baghdad contributed to this report.