Mark Esper was the secretary of the US Army since 2017. (AFP)

The US Senate on Tuesday confirmed Mark Esper as the next secretary of defense, nearly seven months after the surprise resignation of Jim Mattis over policy differences with President Donald Trump.

Secretary of the US Army since 2017, the 55-year-old Esper won overwhelming bipartisan approval from the Senate, and the Pentagon says he is expected to take his oath of office later Tuesday.

Trump tapped Esper to head up the Pentagon when his previous pick, Patrick Shanahan, withdrew for family reasons and resigned as acting secretary, having served in the interim role for six months.