Former defense secretary Robert Gates has signed a deal to publish two books with Alfred A. Knopf, the first a memoir of his tenure under President George W. Bush and President Obama, and the second focusing on leadership, Sonny Mehta, chairman and editor-in-chief of Knopf said Tuesday.

The memoir, still untitled, is tentatively scheduled for 2013, and the leadership book will follow a year later. In the memoir, Gates will reflect on strategy in Afghanistan, the withdrawal of troops in Iraq, his decision to replace Gen. David D. McKiernan with Gen. Stanley A. McChrystal as commander in Afghanistan, and the repeal of the military’s “don’t ask, don’t tell” policy.

“As the nation’s only secretary of defense to serve two presidents of different political parties and with the United States at war every day of my four and a half years in office,” Gates said in a statement, “I want to tell my story of constant conflict abroad and in Washington. I will share insights gleaned from my experience of working for two very different presidents in two administrations of very different political stripes.”

In the second book, Gates will discuss his philosophy about leadership and great leaders he has admired