Ashton B. Carter, a physicist with long experience in national security circles, handily won Senate confirmation Thursday as secretary of defense, becoming President Obama’s fourth pick in six years to lead the Pentagon.

The Senate voted 93 to 5 to approve Carter’s nomination, paving the way for him to be sworn into office sometime in the next few days.

Voting against him were five Republicans senators: Roy Blunt (Mo.), Mike Crapo (Idaho), Mark Kirk (Ill.), James E. Risch (Idaho) and John Boozman (Ark.).

Carter, 60, will replace Chuck Hagel, the former Republican senator from Nebraska who agreed in November to step down after Obama lost confidence in his leadership. The White House has said it wanted a new Pentagon chief to oversee the fight against the Islamic State in Syria and Iraq, as well as the continued drawdown of U.S. troops from Afghanistan.

“With his decades of experience, Ash will help keep our military strong as we continue the fight against terrorist networks, modernize our alliances, and invest in new capabilities to keep our armed forces prepared for long-term threats,” Obama said in a statement.

A Rhodes scholar with eclectic interests — he wrote an undergraduate thesis at Yale on the Latin writings of 12th-century Flemish monks — Carter will return to the Pentagon just 14 months after he resigned as deputy secretary of defense. He previously served as the Pentagon’s chief weapons buyer and also as a senior defense official during the Clinton administration.

During testimony before the Senate Armed Services Committee last week, Carter pledged to keep an independent voice and demonstrated a willingness to differ with the White House. For example, he said he was “inclined” to support arms deliveries to Ukraine and that he would be open to reviewing the timetable for withdrawing troops from Afghanistan.

Sen. Jack Reed (D-R.I.) said Carter would have to focus on existing problems such as the fighting in Ukraine, Syria, Iraq and Afghanistan but also longer-term challenges such as China’s military buildup.

Even more daunting crises, he added, could emerge in the near future. For example, if negotiations with Iran over its nuclear program fail this year, he said, “the consequences could alter the face of the region for generations and generations to come.”

Sen. John McCain (R-Ariz.), the committee chairman, praised Carter on Thursday as a “committed public servant” who has drawn bipartisan support. But he questioned how much sway he would have with the White House.

“When it comes to much of our national security policy, I must candidly express concern about the task that awaits Dr. Carter and the limited influence he may have,” McCain said. He said he had “sincere hope, but sadly little confidence, that the president who nominated Dr. Carter will empower him to lead and contribute to the fullest extent of his abilities.”