White House press secretary Jay Carney on Wednesday dismissed a suggestion from former Defense Secretary Robert Gates that President Obama had opposed the Iraq war troop surge for strictly political reasons.

Carney said that Obama's record showed that he had long opposed the Iraq war and decisions which would prolong U.S. military action in the mideast nation.

“Anybody who has covered Barack Obama back to his race in the Senate knows he was opposed to the Iraq war,” said Carney.

“It doesn’t track based on what I know and what every body knows,” he added of Gates’ claim.

In his new memoir, Gates writes that then-Secretary of State Hillary Clinton and Obama told each other that they had both opposed the 2007 troop surge to some extent because they were facing each other in the 2008 Democratic presidential primary.

“Hillary told the president that her opposition to the [2007] surge in Iraq had been political because she was facing him in the Iowa primary,” wrote Gates, according to excerpts provided to the Washington Post's Bob Woodward. “The president conceded vaguely that opposition to the Iraq surge had been political.

“To hear the two of them making these admissions, and in front of me, was as surprising as it was dismaying,” Gates added.

Gates' memoir charges Obama with losing faith in his Afghanistan policy and criticizes his political advisors, whom the former Pentagon chief said took “micromanagement and operational meddling” to new levels.

Gates also slammed Vice President Joe Biden, saying that he “has been wrong on nearly every major foreign policy and national security issue over the past four decade.”

The White House has hit back against the memoir, saying that Obama “disagrees” with Gates' assessment and calling Biden “one of the leading statesmen of his time.”

“The President deeply appreciates Bob Gates’ service as Secretary of Defense, and his lifetime of service to our country,” added National Security Council spokesperson Caitlin Hayden.