"It is an honour of a lifetime to be appointed Secretary of Defence," Esper said on Tuesday after being sworn in by US Supreme Court Justice Samuel Alito.
US President Donald Trump said he is confident that he will be an outstanding Secretary of Defence.
Earlier on Tuesday, the US Senate confirmed Esper's nomination with a 90-8 vote. He previously served as the defence chief in an acting capacity.
Esper stepped in after the previous nominee, Patrick Shanahan, withdrew his nomination and also resigned as acting defence secretary amid reports about possible domestic violence in a marriage that ended in divorce eight years earlier.
Shanahan had served as acting defence chief since Mattis’ December resignation, reportedly over a disagreement over plans by President Donald Trump to withdraw US troops from Syria.