The Senate easily confirmed retired Gen. James Mattis to be the next defense secretary on Friday, shortly after President Trump took the oath of office, making Mattis the first confirmed member of the new Cabinet.

Mattis' nomination to be the Pentagon's top civilian easily passed the Senate in a 98-1 vote. The only "no" vote came from Sen. Kirsten Gillibrand, D-N.Y. Alabama Sen. Jeff Sessions, who is Trump's nominee for attorney general, didn't vote.

The Senate Armed Services Committee approved his nomination this week in a 26-1 vote in which Gillibrand was again the only opposition.

During his confirmation hearing this month, Mattis painted the picture of a military whose readiness had been gutted by budget cuts and is not strong enough to deter threats from Russia, China and terrorists.

"I think [the world order is] under the biggest attack since World War II, sir, and that's from Russia, from terrorist groups and with what China is doing in the South China Sea," Mattis said at his confirmation hearing on Jan. 12.

Mattis also talked about his commitment to invest in innovation as the defense secretary.

The retired four-star general previously served as the head of U.S. Central Command and retired after 44 years in the Marine Corps in 2013.

The law requires a former military officer to be out of uniform for at least seven years before serving as defense secretary. Because of how recently he retired, Congress had to make an exception to the law for Mattis, which passed both chambers by large margins.

While there was some debate in Congress over whether his appointment would weaken civilian control of the military, he was overwhelmingly praised by lawmakers on both sides of the aisle as a highly qualified candidate for the position.

This story was updated with the final vote total at 5:p.m.