WASHINGTON — In excerpts from his new memoir, former Defense Secretary Robert Gates laments that “over time, the broad dysfunction of today’s Washington wore me down, especially as I tried to maintain a public posture of nonpartisan calm, reason and conciliation.”

He’s not worried about that public persona anymore.

Gates' memoir, to be released Tuesday, created a firestorm inside the beltway this week with its sharp criticism of President Barack Obama, his senior security advisors and his commitment to the military strategy in Afghanistan.

It’s a surprising departure from the reluctant and measured statesman who left town with in 2011, after leading the Pentagon for two presidents during two wars. And despite Gates’ repeated promises to flee the D.C. political scene for good, the book thrusts him back into the political debate over the end of the war in Afghanistan and the future of the military.

In excerpts released by news outlets, Gates also rails against “inquisition-like treatment” and “kangaroo-court” atmosphere of Congress, the “bureaucratic inertia” of the Pentagon, and the ineptitude of Vice President Joe Biden.

Even before the book hit store shelves, White House officials released a statement defending Biden -- “The President disagrees with Secretary Gates’ assessment … Joe Biden has been one of the leading statesmen of his time” -- while tiptoeing around the specifics of the criticisms leveled against Obama’s plans for Afghanistan.

“Gates was always careful of crafting a respected persona, so this is quite shocking,” said Gary Schmitt, a director of security studies at the American Enterprise Institute, a conservative think tank in Washington. “Most of what he said isn’t a surprise, but it’s different for someone like John McCain to say it. It’s another thing for someone in a cabinet level position to come out publicly on this, and so soon.”

Criticizing a sitting wartime president is also jarring, according to Larry Korb, senior fellow at the Center for American Progress, a liberal think tank in Washington. Most war memoirs, at least by senior officials, are published years after the fact, or after a change in administrations.

Schmitt agreed, noting that the controversy couldn’t come at a worse time for a White House already sagging in popularity polls and entering the second year of a lame-duck term. And revelations of conflict over Obama’s lack of commitment to military strategy in Afghanistan will shadow Pentagon efforts to wind down the war by year’s end.

When Gates stepped down, many lawmakers -- including those he routinely sparred with -- hailed the departing secretary as bipartisan hero.

But Korb, a critic of Gates, said much of that legend has become overblown, and that his private interactions and policy decisions showed him to be as politically motivated as other Washington power brokers.

“He talked about budget cuts but left with military spending higher than what even the (President George W.) Bush administration had projected,” he said. “He always tried to have things both ways. Now, he’s trying to say he was the good guy, no matter what problems developed since he left.”

Jim Carafano, vice president of defense policy studies at the Heritage Institute, a conservative Washington think tank, said the often-stinging memoir appears out of character with Gates’ past moves, including his 2007 book recounting the Cold War. That one, written more than a decade after he left the top job at the Central Intelligence Agency, did not contain the same controversy or critiques of the current administration.

Still, he’s reluctant to read too deeply into motivations behind the book based solely on the excerpts. “Remember, the goal here is book sales.”

And, Schmitt joked, maybe Gates was sincere about getting far away from the politics of Washington “and he’s burning all of the bridges so he can’t return.”

shane.leo@stripes.com

Twitter: @LeoShane