In the view of White House officials, Mr. Hagel has helped to thwart Mr. Obama’s pledge to close Guantánamo with his concerns about the security risks posed by the release of detainees. He recently pulled back from plans to repatriate four Afghans who had been approved for transfer, a decision that annoyed Ms. Rice, officials said.

White House officials also expressed annoyance over a sharply critical two-page memo that Mr. Hagel sent to Ms. Rice last month, in which he warned that the administration’s Syria policy was in danger of unraveling because of its failure to clarify its intentions toward President Bashar al-Assad. Senior officials complained that Mr. Hagel had never made such a case in internal debates, suggesting that he was trying to position himself for history on a crucial issue as he was talking to Mr. Obama about leaving his job. Mr. Hagel’s defenders said he stayed quiet to avoid leaks.

“When your cabinet officials feel like they have to write you a letter, that suggests a larger problem,” said Vikram Singh, who worked on Afghanistan policy at the Pentagon under Mr. Hagel and who is now at the Center for American Progress, a Washington research organization with close ties to the Obama administration.

Rear Adm. John F. Kirby, the Pentagon spokesman, credited Mr. Hagel for managing the Pentagon after it had spent more than a decade at war. “It’s easy to go from peace to war,” Admiral Kirby said. “It’s more difficult to go from war to peace.” He called Mr. Hagel “the first defense secretary in nearly two decades to be confronted with the reality of shrinking budgets as well as the actual impact” of automatic defense budget cuts.