President Trump's defense secretary, retired Marine General James Mattis took charge of the Pentagon on Saturday - and was saluted by a fellow member of the Corps.

Marine General Joseph Dunford, Chairman of the Joint Chiefs of Staff, greeted him as he was driven to his office for the first time - a reunion for two Iraq veterans.

Mattis shook hands with Gen Dunford before being escorted inside the Pentagon where he is getting down to work.

Semper fidelis: Marine General Joseph 'Fighting Joe' Dunford salutes his former commanding officer, retired Marine General James 'Mad Dog' Mattis as he arrives at the Pentagon

Brothers in arms: Marine General Dunford was nicknamed 'Fighting Joe' when he served under Marine General James Mattis in Iraq - where the new defense secretary was known as 'Mad Dog'

Down to work: Mattis was sworn in at the first possible minute on Friday and arrived at the Pentagon on Saturday morning.

The two served together in Iraq, where Mattis led the 1st Marine division in 2003 and 2004.

Under his command was Dunford, first commanding the 5th Marine Regiment, then chief of staff for the division, and finally as assistant commander of the division,

Dunford earned the nickname 'Fighting Joe' and went on to hold a series of more senior roles, including Commandant of the Marine Corps, and became Chairman of the Joint Chiefs in May 2015.

The two were re-united on the morning after Mattis became the first member of the Trump cabinet to be sworn in.

Vice President Mike Pence fetched retired Mattis and his fellow retired Marine General John Kelly and took them to the Eisenhower Executive Office Building so they could be 'immediately' sworn in as Defense and Homeland Security Secretaries, according to White House press secretary Sean Spicer.

That followed Trump's first two signatures in the Oval Office, officially commissioning them in their new positions.

Mattis became the U.S. secretary of Defense after he took the oath of office, which Pence himself administered. Kelly has taken over the Department of Homeland Security.

Mattis take the oath: The retired Marine General was sworn in by Vice-president Mike Pence immediately after Trump signed the waiver allowing the move into law

IT'S GOOD TO BE BACK: MAD DOG MATTIS' MESSAGE TO THE FORCES It’s good to be back and I’m grateful to serve alongside you as Secretary of Defense. Together with the Intelligence Community we are the sentinels and guardians of our nation. We need only look to you, the uniformed and civilian members of the Department and your families, to see the fundamental unity of our country. You represent an America committed to the common good; an America that is never complacent about defending its freedoms; and an America that remains a steady beacon of hope for all mankind. Every action we take will be designed to ensure our military is ready to fight today and in the future. Recognizing that no nation is secure without friends, we will work with the State Department to strengthen our alliances. Further, we are devoted to gaining full value from every taxpayer dollar spent on defense, thereby earning the trust of Congress and the American people. I am confident you will do your part. I pledge to you I’ll do my best as your Secretary. Advertisement

The Senate approved both men's nominations Friday afternoon and evening by overwhelming majorities.

Republicans arranged for a vote on Rep. Mike Pompeo to become director of the CIA on Monday, following an objection from Oregon Sen. Ron Wyden, a civil libertarian who is concerned about Pompeo's stance on electronic surveillance.

Mattis was confirmed by a 98-1 vote, with only New York Democratic Sen. Kirsten Gillibrand objecting.

Lawmakers had first passed a special waiver allowing Mattis, who retired in 2013, to serve before a customary seven-year limit on former military personnel assuming the Pentagon's top post.

Gillibrand maintained that the special carve-out was inappropriate, but it became the first law Trump signed as president.

In his first official statement, Trump said he was ' proud' to have Mattis and General John Kelly, who the Senate confirmed to Homeland Security, in his administration, calling them 'American heroes.'

In the Pentagon: The Senate passed James Mattis's nomination 98-1 - making him the first official member of Trump's cabinet

Controlling the borders: John Kelly was confirmed as Homeland Security 88-11

'I call on members of the Senate to fulfill their constitutional obligation and swiftly confirm the remainder of my highly qualified cabinet nominees, so that we can get to work on behalf of the American people without further delay,' Trump said in a White House statement.

Mattis has won accolades from both parties and many in the armed forces, and his path to the cabinet was relatively uncontroversial compared to that of many of Trump's other nominees.

A cornerstone of US democracy is that civilians, not people in uniform, control the military, and the commander-in-chief is the president.

Some in Congress initially raised eyebrows because Mattis, a 66-year-old Washington state native, had only retired from active duty in 2013.

Such a waiver was only granted once before, for the famous World War II General George Marshall who served under President Harry Truman from 1950-1951.

Mattis is known as a colorful commander and is famed for his pugnacious aphorisms. The media dubbed him 'Mad Dog' for his battle-hardened swagger and the sort of blunt language Marines are famous for.

He has been quoted as saying, 'Be polite, be professional, but have a plan to kill everyone you meet.'

But Mattis also has a well-known cerebral side: he issued reading lists to Marines under his command, and instructed them that the most important territory on a battlefield is the space 'between your ears.'

While Mattis sailed through his confirmation, Democratic lawmakers are putting up stiff resistance to other Trump cabinet picks, including the proposed education secretary and the health and human services secretary nominee.

Mattis replaces Ashton Carter, a longtime Pentagon bureaucratic warrior who served as former president Barack Obama's fourth defense secretary.

Senators also confirmed John Kelly's nomination to lead the Homeland Security Department, 88-11.

Among Kelly's likely first assignments will be executing Trump's plans for the fate of a program that has protected more than 750,000 young immigrants from deportation.

If Trump keeps his campaign promises, Kelly's agency will be responsible for strengthening the screening of immigrants permitted to enter the U.S. His department also will be charged with finding additional resources to locate and deport people living here illegally.

Kelly says he's in favor of a wall at the Mexican border, but he says a physical barrier alone isn't enough to secure the 2,000-mile frontier.

Trump is signing documents to allow them to be sworn in immediately.