Media playback is unsupported on your device Media caption Chuck Hagel announces he is to step down as US defence secretary

Chuck Hagel has resigned as US defence secretary after less than two years in the top post.

President Barack Obama confirmed his resignation and paid tribute to his "class and integrity".

Mr Hagel, 68, a Vietnam war veteran and former Republican senator, said it had been his life's "greatest privilege".

Last month, it was reported that he was sharply critical of the US strategy against Islamic State and in relation to the Syria regime.

He will stay on as secretary until his successor is confirmed.

An unnamed official told the Associated Press news agency that Mr Hagel and Mr Obama both "determined that it was time for new leadership in the Pentagon" and had been discussing the move for weeks.

Mr Obama said Mr Hagel had come to him to discuss the "appropriate time to complete his service".

The US president said he was "extraordinary lucky" to have Mr Hagel by his side as defence secretary and praised him for forging a strong bond with US troops.

Mr Hagel is the first enlisted combat veteran to serve in the role.

In a brief statement, Mr Hagel said it had been the "great privilege of my life to lead and most importantly to serve the men and women of the defence department".

Image copyright AP Image caption Hagel's 58-41 confirmation was the narrowest ever vote margin for a Pentagon nominee

Analysis, Jon Sopel, North America Editor

Chuck Hagel is a friendly, no-nonsense defence secretary. He was also the one Republican in the White House national security set-up.

But that may be of lesser importance than him being appointed to do one task in the Pentagon, only to find that the job description has changed fundamentally.

He was the man appointed to bring the troops home and pare back the huge defence budget. But then Islamic State came along and all the calculations changed, and Mr Obama and his defence chief found themselves at odds.

There was a lack of clear strategy, perhaps because Mr Obama and Mr Hagel didn't agree on what it should be. And after mid-term political defeats, the president needs a military win. So a change at the top will be an important symbol of that determination.

Which of course leaves the question, did he jump or was he pushed? Probably a bit of both.

Mr Hagel, who served as Republican senator for his home state of Nebraska for 12 years, became critical of US involvement in Iraq despite voting to authorise the war.

He replaced Leon Panetta as defence secretary in Mr Obama's second term, taking on the task of winding down the Afghanistan war and making a military shift towards Asia.

But the future of US military policy has changed amid air strikes against IS in Iraq and Syria.

"The next couple of years will demand a different kind of focus," an unnamed White House official told the New York Times, which first broke the story.

US media report there was increasing tension between Mr Hagel and the administration over decisions in Syria and working styles, citing Hagel confidantes and senior defence officials.

Image copyright Getty Images Image caption Runners and riders - former deputy defence secretary Ashton Carter, former Pentagon policy chief Michele Flournoy and Senator Jack Reed (l-r)

Republican Senator John McCain said he knew the defence secretary "was frustrated with aspects of the administration's national security policy and decision-making process".

Mr McCain said Mr Obama needed to realise "current failures on national security more often lie with his administration's misguided policies".

Mr Obama did not name a replacement for Mr Hagel on Monday. Once named, the nominee would have to be confirmed by the Senate.

Among those being considered as replacements for Mr Hagel is Michele Flournoy, the former Pentagon policy chief during Mr Obama's first term.

If nominated and confirmed Ms Flournoy would be the first female US defence secretary.