WASHINGTON — President Obama has selected Ashton B. Carter to be the next defense secretary, senior administration officials said on Tuesday, elevating a physicist and the Pentagon’s former chief weapons buyer to succeed Chuck Hagel, who was ousted last week.

As a former deputy defense secretary with a long history at the Pentagon, Mr. Carter helped accelerate the production and shipment of weaponry and armored vehicles to protect American troops from roadside bombs during the wars in Iraq and Afghanistan. Now, as the American military is building up again in Iraq, this time to fight Sunni militants with the Islamic State, Mr. Carter must manage the war effort as well as the intense budget pressures on the Pentagon in the face of mandatory spending cuts.

Mr. Carter’s formal nomination is expected in the next few days once the White House completes the vetting process, aides said. He is the only one of several top prospects who did not take himself out of the running for the job.

“It’s how much grief you want,” said Anthony H. Cordesman, a national security expert with the Center for Strategic and International Studies. “There’s a confirmation process where anyone with the political profile which the White House wants would run into a buzz saw in the Senate.”