Johnson will be the first African-American to lead the huge department, and only the fourth person to head DHS since it was created by then-president George W Bush in 2002, one year after the 9/11 attacks.

Johnson won confirmation 78-16. He could be sworn in as early as this week in order to begin immediately tackling some departmental priorities including stiffening border security, upgrading airport protections and improving immigration enforcement operations.

"In Jeh, our dedicated homeland security professionals will have a strong leader with a deep understanding of the threats we face and a proven ability to work across agencies and complex organisations to keep America secure," President Barack Obama said in a statement praising the bipartisan vote.

"As secretary of Homeland Security, Jeh will play a leading role in our efforts to protect the homeland against terrorist attacks, adapt to changing threats, stay prepared for natural disasters, strengthen our border security, and make our immigration system fairer."

As the Pentagon's top lawyer, Johnson was responsible for a prior legal review of every military operation ordered by the president or the defense secretary.

In October, when he announced his nomination, Obama said Johnson was an "absolutely critical" member of his national security team and had been at the heart of many of the policies that have kept America safe.

Johnson oversaw a legal team of thousands at the Pentagon. He also served for two years as an assistant US attorney, and had the backing of previous DHS secretaries Tom Ridge, Michael Chertoff and Janet Napolitano, who left the position earlier this year.

Republican Senator Jeff Sessions, who opposed the confirmation, said it was vital to bring in a seasoned manager and national security expert to bring swift and credible order to the agency, but that Johnson "doesn't come close" to meeting that challenge.

DHS is an amalgamation of 22 separate agencies with 240,000 employees. The critics have, however, argued that the department is in disarray.