Jan. 20 (UPI) — The full Senate on Friday confirmed the first two members of President Donald Trump’s Cabinet, both of whom will play key roles in guarding the national security of the United States.

The upper chamber first confirmed former Gen. James Mattis as defense secretary — clearing the final obstacle to what was seen by some as an iffy appointment.

The vote wrapped a nomination that some Republicans worried might not succeed — particularly because Mattis also needed a waiver from Congress to serve in the post, because he retired from active duty only three years ago instead of the seven required by federal law.

Both chambers of Congress passed the waiver last week and it was the very first thing Trump signed after his inauguration Friday.

Mattis, 66, a 44-year USMC veteran, will dictate Pentagon policy and serve as a key adviser to Trump on matters of national security. He replaces Ashton Carter, former President Barack Obama’s defense secretary, at the Pentagon.

Last week, Mattis testified on a number of issues before the Senate Armed Services Committee, which subsequently approved his appointment.

A short time later, Kelly also received a formal nod from the Senate to begin work as Trump’s secretary of homeland security.

Kelly, also a former Marine Corps general, was one of the first Cabinet appointees to receive a confirmation session last week before the Senate Committee on Homeland Security and Governmental Affairs.

During his committee hearing, Kelly said he has no problem taking a stand to authority figures — reassuring some Democrats who wondered whether he would take opposing viewpoints with Trump on critical national security matters.

Kelly, 66, replaces Jeh Johnson in the department.