The Obama administration found itself on defense Friday after former Defense Secretary Leon Panetta criticized the White House for its policies on Iraq, with the State Department and others publicly disputing his claims. 

Panetta chided the president's team in his forthcoming memoir, excerpts of which have been published in the media. He alleges the White House didn't try hard enough to strike a deal with Iraq in 2011 to leave a residual force of U.S. troops behind, in turn opening the door for the region to become a haven for the Islamic State. 

In newly published excerpts, he also criticized the administration over its policies toward Syria. 

But speaking with Fox News on Friday, State Department spokeswoman Jen Psaki claimed Iraqi officials simply did not want U.S. troops to remain after 2011 and no amount of extra prodding by the White House could have made the difference. 

"It wouldn't have changed the circumstance we're in today," she said. "It would not have mattered. They did not want to have troops in Iraq." 

More On This...

Vice President Biden also appeared to take a swipe at the book during a talk Thursday at Harvard Kennedy School. 

"I'm finding that former administration officials as soon as they leave write books, which I think is inappropriate," Biden said, to laughter. "No I'm serious -- I do think it's inappropriate. At least, you know, give the guy a chance to get out of office." 

Despite Psaki's comments, Panetta was adamant in his book that there was an opportunity to strike a deal with the Iraqis that could have kept U.S. troops in the country. 

He claimed Iraqi leaders privately wanted some U.S. forces to stay behind, though they would not say so publicly. 

"But," he wrote, "the President's team at the White House pushed back, and the differences occasionally became heated. ... and those on our side viewed the White House as so eager to rid itself of Iraq that it was willing to withdraw rather than lock in arrangements that would preserve our influence and interests." 

He said the negotiations with then-Prime Minister Nouri al-Maliki went down to the wire in December 2011, but the White House never stepped up. 

"To my frustration, the White House coordinated the negotiations but never really led them," Panetta charged, in excerpts published by Time

On Fox News, Psaki suggested that such a small residual force might not have made much difference anyway. She also repeated the claim -- disputed by many Republicans in Congress -- that few anticipated the security situation would deteriorate so badly. 

"No one anticipated that the Iraqi security forces would have been unwilling to fight," she said. "Nobody anticipated that ISIL would be as strong." 

The Daily Beast published additional excerpts of the memoir on Friday in which Panetta criticized the president for striking an agreement to shelve attacks on the Assad regime in exchange for him turning over chemical weapons -- after Obama drew a "red line" on their use that Assad allegedly crossed. 

"The result, I felt, was a blow to American credibility. When the president as commander in chief draws a red line, it is critical that he act if the line is crossed," Panetta wrote. He criticized what he saw as "hesitation and half steps" in dealing with Syrian rebels.  

Panetta, who worked in top positions in the Clinton White House, also described the Obama administration as far different in the way it operates. 

"Far more than in previous administrations that I'd witnessed-certainly more than in Clinton's when I'd been near the center of the action-President Obama's decision-making apparatus was centralized in the White House," he reportedly wrote. 

Panetta also said he opposed the controversial trade of American soldier Bowe Bergdahl for five Taliban commanders at Guantanamo Bay. He said he did not believe the Taliban were "sincere" about reconciling with the Afghan government and, "I did not believe it was fair to trade five for one." 

Panetta was director of the CIA from 2009-2011, and secretary of Defense from 2011-2013.