WASHINGTON — The former US military commander in Afghanistan, General David Petraeus, rejected suggestions to resign over disagreements with President Barack Obama, concluding it would be a "selfish, grandstanding move," a new book says.

"All In: The Education of General David Petraeus," describes how the general -- now CIA director -- had a "tense moment" with the president about his disagreement with Obama's decision to withdraw 33,000 US reinforcements from Afghanistan by October 2012, according to an excerpt quoted by Politico.

Conservative writer Max Boot told Petraeus he would work on his campaign if the general quit and run for president, according to the book written by Paula Broadwell with Vernon Loeb.

But Petraeus said he had no intention of running for president and that "quitting was not the answer."

The four-star general, who rose to prominence for his role in salvaging the US mission in Iraq, had long studied relations between civilian leaders and the military and what circumstances might justify an officer resigning in protest, the authors wrote.

"Obama's decision to draw down forces faster than he recommended did not, in his mind, begin to approach the threshold for such an extraordinary act as resignation," according to the book.

"He thought it would have been a selfish, grandstanding move with huge political ramifications.

"He had had ample opportunity to provide input and give his best advice, and now it was time to salute and carry on."

At a Senate hearing on June 23 after Obama unveiled his drawdown plans in Afghanistan, Petraeus was asked by Senator Carl Levin if he was prepared to resign over war policy.

Petraeus acknowledged he had received emails suggesting he resign but said: "I don't think it's the place for the commander to consider that kind of step unless you are in a very, very dire situation."

Broadwell, a West Point graduate, gained extensive access to Petraeus and his subordinates during his tenure as commander in Afghanistan as well as interviews with the general's longtime friends and mentors, said the book's publisher, Penguin Press, which plans to release the account on January 24.