US Defense Secretary Chuck Hagel has resigned, with the White House under fire over perceived fumbling in its response to the Islamic State threat.
On jihadist websites and Twitter accounts, Islamic State supporters celebrated "victory" against Hagel, claiming he had been forced out by their successes against US allies on the battlefield.
The former Republican senator, who has been in the job for less than two years, was chosen to oversee a shift to a peacetime military with smaller defence budgets, but found the US at war again.
Rapid advances by Islamic State jihadists in Syria and Iraq forced the Pentagon chief into managing a complex campaign, and President Barack Obama concluded Hagel was not the man for the task.
The 68-year-old Vietnam war veteran joined Obama at the White House to confirm his departure.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
"When I asked Chuck to serve as secretary of defense we were entering a significant period of transition: the drawdown in Afghanistan, the need to prepare our forces for future missions and tough fiscal choices to keep our military strong and ready," Obama said.
"Last month, Chuck came to me to discuss the final quarter of my presidency and determined that, having guided the department through this transition, it was an appropriate time for him to complete his service."
Hagel thanked Obama for his "friendship", saying he believed he had put the military and the nation on a "stronger course toward stability".
Both Obama and Hagel presented the decision as mutually agreed, but administration officials privately suggested he had been pushed out, while Obama's critics said Hagel had been frustrated by White House meddling.
Some commentators said Hagel had run afoul of Obama's aides by siding with military commanders in internal policy debates, but officials denied the claim.
White House spokesman Josh Earnest told reporters Obama and Hagel agreed it was time for "new leadership".
"It doesn't mean that Secretary Hagel hasn't done an excellent job of managing these crises as they've cropped up, but it does mean that as we consider the next remaining two years of the president's time in office that another secretary might be better suited to meet those challenges," Earnest said.
The White House did not say who would replace Hagel at the Pentagon, but in Washington three candidates are deemed to be in the running.
The former third-highest ranking official at the Pentagon, Michele Flournoy - who would be the first woman to hold the top post - is touted as the most likely choice, followed by former deputy secretary Ashton Carter.
Senator Jack Reed of Rhode Island - a former army airborne officer - has also been cited as a plausible contender, but his spokesman told reporters that he was not interested in the job.
Although administration officials indicated Hagel had been pressured to resign, a senior national security staff member in congress told AFP that was not the case.
"Hagel quit," the aide said. "Hagel found himself at odds with the administration."
Hagel's experience was similar to that of his predecessors, Robert Gates and Leon Panetta, who both complained after they left office of interference by White House political appointees, some lawmakers said.
Hagel had been "very, very frustrated", said senator John McCain, an outspoken critic of Obama's foreign policy.
"Already the White House are leaking, 'Well he wasn't up to the job.' Believe me, he was up to the job," he said.
McCain said the administration had "no strategy" to fight the IS extremists and that Hagel had never been allowed into an inner circle making decisions.
Hagel had disagreed with the administration's approach to Syria, writing a two-page memo arguing for a more assertive stance towards President Bashar al-Assad, his aides recently disclosed.

