In Ricks’s portrayal, Odierno was an unequivocal disaster during this phase of the war. Instead of trying to win over the Iraqi people, “he hammered everyone,” a retired Army general told Ricks, explaining that the soldiers in Odierno’s unit had treated Iraqi civilians in a brutal manner. Another general said: “The 4th ID—what they did was a crime.” Even before he wrote Fiasco, Ricks had become a controversial figure among high-level military officials at the Defense Department. His critical Washington Post articles, which became the basis for Fiasco, apparently infuriated then-Defense Secretary Donald Rumsfeld and other officials at the Pentagon—so much so that a faculty member at the Army War College told his colleagues, in an e-mail to other faculty members in 2005, not to grant Ricks interviews: “We all need to avoid Tom like the plague.” The faculty member eventually apologized, explaining that he had written the e-mail during a time when many were afraid of incurring Rumsfeld’s wrath by consorting with Ricks. Many of the officers who had served in Iraq, however, appreciated, in a quiet way, the work that Ricks was doing: “I thought the book was very balanced and realistic,” said Colonel Barry Johnson, who was at the time a military spokesman in Baghdad.

While Ricks was giving talks about Fiasco in the U.S., the situation in Iraq began to change dramatically—so much so that Ricks proceeded to write a sequel. Petraeus took over as commanding general in February 2007 and strategy in Iraq underwent a major transformation, largely in the direction that Ricks had long advocated. The U.S. sent in some 30,000 additional troops, and “essentially, early in 2007 the Bush Administration and the U.S. Army turned the war over to the dissidents, people like Petraeus who had criticized the way much of the U.S. effort in Iraq had been conducted for most of its duration,” Ricks wrote in an April 2007 postscript to the paperback edition of Fiasco.

He went back to Iraq four or five times—Ricks himself is unsure of the count—while researching the new book. He was impressed with what he saw. And by then Petraeus and others who had been his sources for Fiasco—including Peter Mansoor, a brigade commander in Baghdad, and Sean MacFarland, a commander in Ramadi—were playing key roles in the war. Ricks had extraordinary access.

In May 2007, Ricks attended a military briefing in the Green Zone. When listening to briefings in the past, he had often felt that he knew more about the situation in Iraq than the briefers did. This time, he thought, “ ‘Wow, not only does this briefing strike me as accurate, it also is better said than I could do,’ ” he explained on Amazon.com.

The conversations that Ricks had with Petraeus became a crucial part of his reporting for The Gamble. “The deal was that I would do several trips to Iraq during his time in command there, and have candid interviews with him and other officers, almost all of them not to be used until the end of 2008,” Ricks explained in an online Washington Post chat in February 2009. For Fiasco, Odierno would not talk to Ricks except at the very end of his reporting; this time, Ricks had repeated meetings with him. “To his credit, Odierno was very open and candid with me in the reporting of The Gamble,” Ricks told me. “He didn’t have to be. He was generous with his time and his thinking.” Ricks also spent a lot of time with David Kilcullen and Emma Sky, two aides to the generals, and was impressed with both.

Tara McKelvey is the author of Monstering: Inside America's Policy of Secret Interrogations and Torture in the Terror War and is a 2011 Guggenheim Fellow. Research assistance was provided by Jed Bickman of the Investigative Fund at The Nation Institute, which also provided financial support for preparation of this article.