The Pentagon's number-two ranking official is stepping down from his post, officials said Thursday amid reports of strains between him and his boss, US Defense Secretary Chuck Hagel.

The surprise announcement came in a statement from Hagel, who said he had "reluctantly accepted" Ashton Carter's decision to resign in a meeting earlier Thursday.

"Ash has been an extraordinarily loyal and effective Deputy Secretary," Hagel said.

Carter was due to remain in the job for another two months to help the Pentagon as it grapples with a government shutdown and automatic budget cuts, officials said.

Carter, who had served as the deputy from October 2011 under former defense secretary Leon Panetta, had reportedly enjoyed more autonomy under the previous Pentagon chief and had been on a short list to succeed Panetta in the top post.

Hagel has had a more hands-on approach than Panetta and had wanted Carter's role more strictly defined with a primary focus on the defense budget instead of broader policy issues, according to some former officials and a recent report in Foreign Policy.

But defense officials on Thursday rejected that idea and insisted there was no serious strain between Carter and Hagel.

They said the outgoing deputy defense secretary enjoyed an excellent professional relationship with the Pentagon chief.

"There was no conflict," said a defense official, who spoke on condition of anonymity.

Pentagon press secretary George Little said the decision to leave the Pentagon "was Deputy Secretary Carter's and his alone."

"He'll be missed by the Secretary. They've had a strong and effective working relationship and friendship that will continue for the next two months and beyond." he said in an email.

Before starting as the Pentagon number two, Carter had worked as the undersecretary of defense for acquisition, the top US weapons buyer, technology and logistics, overseeing an urgent effort to buy heavily-armored vehicles to better protect troops in Afghanistan.

In a resignation letter, Carter said he had long planned to wrap up his tenure on December 4th but had postponed making the announcement due to the "turbulence surrounding the fiscal situation."

Carter said he would now focus on "my next big challenge," though he did not elaborate.

"So it is time for me to go."

A former Harvard professor and Rhodes scholar who earned a doctorate in theoretical physics from Oxford University, Carter had served at the Pentagon during Bill Clinton's presidency in the 1990s and is deemed an expert on arms control.