WASHINGTON — President Obama will nominate Ashton Carter, a physicist with long experience at the Pentagon, as his new secretary of defense, according to current and former U.S. officials familiar with the decision.

If confirmed by the Senate, Carter will succeed Chuck Hagel, the former Nebraska senator who is being pushed aside by the White House after less than two years in the job. Hagel, a Republican, fell out of favor with Obama and the president’s inner circle as the U.S. military became embroiled in a new war in the Middle East, a challenge that is expected to preoccupy the Obama administration for the remainder of its term.

Although Carter has more experience as a technocrat than as a wartime leader, his extensive national-security credentials and support for his nomination in Congress made him an appealing choice.

White House press secretary Josh Earnest declined Tuesday to confirm that Carter is the president’s selection, but praised him fulsomely. He said Carter had “served the president and the American people well” at the Pentagon.

“He is somebody who deserves and has demonstrated strong bipartisan support for his previous service in government,” Earnest said. “He has a detailed understanding of the way the Department of Defense works.”

Officials said the timing of a formal announcement is still being worked out. Already, however, several lawmakers were predicting that Carter would be easily confirmed.

“Great, very highly qualified,” said Sen. Carl Levin, D-Mich., the chairman of the Senate Armed Services Committee. Sen. John McCain, R-Ariz., who will replace Levin as chairman next month, called Carter a “noncontroversial” choice. Both senators said they had yet to receive formal notification from the White House of Carter’s selection.

Carter, 60, is little known outside Washington but is renowned for his intellect. A Rhodes scholar, he earned a doctorate in theoretical physics from Oxford University and holds degrees in physics and medieval history from Yale University. A longtime faculty member at Harvard University, he began lecturing at Stanford University this fall.

Formerly the No. 2 at the Pentagon and before that its chief weapons buyer, Carter was passed over for the top job in early 2013 when it went to Hagel instead.

Carter stayed on for a year as deputy defense secretary – essentially, the chief executive of the Pentagon bureaucracy – but his relationship with Hagel was seen as awkward. When he stepped down, Carter simply stated in his resignation letter that it was “time for me to go.”

At a farewell ceremony for Carter at the time, he was jokingly lauded as a “middle-aged uber-wonk” by Army Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff. “I think he’s been called the most important, least known figure in Washington, or some language to that effect, and I agree with that,” Dempsey said.

Carter would be the first defense secretary to come of age after the Vietnam War. He graduated from Yale in 1976, three years after the end of the U.S. draft.

He did not serve in the uniformed military but first joined the Pentagon in 1981 as a civilian analyst, working on missile defense, the nuclear arsenal and programs to ensure the continuity of government in the event of nuclear war. One of his early projects was to assess the merits of a pie-in-the-sky scheme to make it difficult for the Soviet Union to track MX missiles by deploying them on giant blimps over the United States.

As his career progressed, Carter became the rare high-ranking Pentagon official who had a granular understanding of how its most sophisticated weaponry worked.

“I think his particular skill set is the ability to combine a technical intelligence, a knowledge of the technical, esoteric dimensions of defense, with a broad policy perspective that’s informed by history,” said Joseph Nye, who worked with Carter on the Harvard faculty and served with him at the Pentagon during the Clinton administration.

In addition to studying the minutiae of theoretical physics, Carter wrote an undergraduate thesis at Yale on the Latin writings of 12th century Flemish monks.

“There was no relationship between them in my mind except that both fascinated me,” Carter said of his education in history and physics, according to a short autobiographical paper he wrote for Harvard’s Kennedy School of Government in 2007. “I liked dusty archives, learning to decipher manuscripts in medieval script . . . Physics was entirely different: clean and modern, logical and mathematical.”

Carter also has an earthy side that displayed itself during his stints at the Pentagon. Former colleagues said he speaks plainly and, at times, can curse like a drill sergeant.

According to his autobiography, he was fired from his first job at a Philadelphia car wash at age 11 “for wise-mouthing the owner.” Among other occupations that he listed from his pre-college years were gas-pump attendant, hospital orderly, fishing boat crewman and counselor for a suicide-prevention hotline.

Carter is set to become the first deputy defense secretary to ascend to the top since 1994, when William Perry replaced Les Aspin, a former congressman who resigned after a short and turbulent tenure.

Perry, in turn, has been as a longtime mentor to Carter, who served under him at the Pentagon during the Clinton administration. Prior to that, they worked closely together on U.S. government programs to secure and dismantle parts of the Soviet nuclear arsenal in the aftermath of the Cold War.

In a phone interview Tuesday, Perry called Carter “superbly qualified” to become defense secretary. He described Carter as a good listener but also “hard-charging” and intense.

“People who work for him who are not moving hard or fast tend to get run over by that,” said Perry, now a professor emeritus at Stanford. “That was perhaps most manifest when he was deputy secretary of defense and basically kind of ran the Pentagon.”

As deputy defense secretary from 2011 to 2013, Carter’s tenure was marked by fiscal uncertainty at the Pentagon. He managed steep cuts in projected defense spending imposed by the Obama administration and Congress – a retrenchment that is expected to continue for at least the next two years.

Unlike Hagel and his predecessor, Leon Panetta, who were both outsiders unaccustomed to managing the military, Carter is already familiar with the vastness of the Pentagon bureaucracy and will be quick to take charge, according to those who know him.

“If you don’t do your homework, if you don’t approach this job with rigor and energy and discipline,” said a former senior defense official who spoke on condition of anonymity, “the building will be running you more than you will be running it. And Ash Carter knows that.”

The arena where Carter is less tested is the public spotlight, a powerful but unforgiving place that constantly follows whoever is in charge at the Pentagon. Having served under six previous defense secretaries, the medieval scholar has already observed the fickle nature of the job.

“Public service at senior levels in Washington is a little bit like being a Christian in the Coliseum,” Carter wrote in his autobiography. “You never know when they are going to release the lions and have you torn apart for the amusement of onlookers.