The US Senate on Tuesday confirmed former soldier Mark Esper as the new Secretary of Defence, after the post was left vacant for a record time. President Donald Trump's second Pentagon chief will take over nearly seven months after the shock departure of James Mattis, the respected US Marine who broke with Mr Trump over policy towards the Middle East and Afghanistan. Two others were made acting defence secretary this year to fill the void, including Patrick Shanahan, who served a six-month temporary stint but resigned for family reasons in June. Mr Esper sailed through the confirmation process with wide bipartisan support. He was confirmed by 90 votes to eight. He is expected to take his oath of office later on Tuesday, the Pentagon said. Mr Esper's confirmation brings stability to the Pentagon as the US deals with wars in Syria and Afghanistan, and is tested by Iran. Republican Senate majority leader Mitch McConnell hailed Mr Esper, who served for two years as secretary of the US Army starting in 2017, as "a thoroughly well prepared nominee". Mr McConnell said he had the respect of the national security community and could hit the ground running. "The world is full of serious threats to America, to our allies and to our interests, not least among them obviously is Iran's insistence on continuing to ratchet up tensions in the Middle East," he told the Senate on Monday. "Having a Senate-confirmed secretary of defence, especially one of this quality, could not come a moment too soon." Mr Esper has significant Middle East experience. He fought in Iraq during the Gulf War in 1991, and was part of the US Army's 101st Airborne Division, known as the Screaming Eagles. He is also close to Secretary of State Mike Pompeo, with whom he studied at the prestigious West Point Military Academy. Both graduated in 1986. Mr Esper was an adviser to several politicians in Washington, including Republican senator Chuck Hagel, who later became secretary of defence under Barack Obama. But his links with the defence industry caused a stir during his confirmation process. Democratic senator Elizabeth Warren, a 2020 presidential candidate, raised possible conflicts of interest about Mr Esper's affiliation with defence contractor Raytheon, for whom he was a lobbyist when Mr Trump called on him to become army secretary. "At the age of 18, I went to West Point and I swore an oath to defend this constitution, and I embraced a motto called 'duty and honour and country'," he told Ms Warren. "And I've lived my life in accordance with those values ever since then. I went to war for this country."