Mark Esper, an army veteran and former defense industry lobbyist, was sworn in as the US secretary of defense after receiving Senate confirmation on Tuesday.

Esper’s confirmation, by a vote of 90-8, comes after a seven-month vacancy in the post. He was sworn in hours later at the White House by the supreme court justice Samuel Alito in a ceremony attended by Donald Trump.

“He’s going to be a great one,” Trump predicted at the swearing-in.

Esper will succeed the Marine general Jim “Mad Dog” Mattis. His confirmation ends a record stretch for the Pentagon without a secretary of defense, which began when Mattis stepped down last December after clashing with Trump over the withdrawal of US troops from Syria and Afghanistan.

Trump initially nominated Patrick Shanahan, who served as acting secretary of defense until the disclosure of domestic violence incidents within his family caused the former Boeing executive to withdraw from the nomination process in June.

One of the central questions facing Esper is whether he can settle the Pentagon’s leadership turmoil. Several key leadership posts are vacant or will be imminently, including deputy secretary of defense, vice-chairman of the Joint Chiefs of Staff, and head of US Strategic Command.

The larger question for Esper, who served as secretary of the army in 2017 after leaving the private sector, will be the unfolding crisis with Iran.

Esper has a wide range of experience in defense matters, including time on Capitol Hill as a congressional staff member.

He also has some first-hand knowledge of the region, having served in the 101st airborne division and participated in the 1990-91 Gulf war. He later served as the deputy assistant secretary of defense for negotiations policy during the George W Bush administration.

Esper worked was a lobbyist for Raytheon, a major defense contractor, for several years before becoming army secretary. He has said he intends to continue the Trump administration’s focus on improving the combat preparedness of the military, nurturing security alliances around the world, and reforming Pentagon business practices.

“Esper’s background is in the military and in the private sector at Raytheon working with the Pentagon, but not in negotiating a delicate settlement with a country the US has a checkered relationship with,” Carl Tobias, a professor of law at the University of Richmond, told the Guardian.

“I don’t know how much of a diplomat or statesman he is and that’s what this is all about – finding some way to tamp down the tension that’s so high right now.”

The big question is whether Esper can improve the Pentagon’s influence within the administration and counter the influence of Iran hawks, including the secretary of state, Mike Pompeo, and the national security adviser, John Bolton.

“First off, he has to get in to the good graces of the president and move the president away from some of the pressure from Bolton and Pompeo, to back down a little and not confront Iran all the time,” added Tobias. “Maybe he’s smart enough to know how to navigate that and has a pragmatic view of what this could lead to because he’s been there.”

At a minimum, Esper’s rapid confirmation suggests the Senate would rather have him in place than an empty post.

Eight Democratic senators voted against Esper’s nomination, including the 2020 presidential hopeful Senator Elizabeth Warren, who has been sharply critical of him for declining to recuse himself from all matters involving Raytheon for the duration of his government service.

“This smacks of corruption, plain and simple,” Warren said at the confirmation hearing. “Will you commit that during your time as defense secretary that you will not seek any waiver that will allow you to participate in matters that affect Raytheon’s financial interests?” Esper said he would not.

The Democratic representative Adam Smith, who is chairman of the House armed services committee, said he was encouraged by Esper’s confirmation but worried by the continuing problem of vacancies in the Pentagon.

“The complex challenges that we face around the globe are too serious for key positions at the Department of Defense to remain transient,” Smith said.

“Instead, our country needs predictable leadership at the Pentagon, capable of withstanding internal political pressure in what has been a historically turbulent administration.”