The Senate on Friday confirmed President Biden's defense secretary, Lloyd Austin, in a big bipartisan vote, marking the first time an African American will lead the Pentagon in U.S. history.

The vote was 93-2. 

Austin is a former four-star Army general who served in the military for 41 years before retiring in 2016. He was the commander of the U.S. Central Command, where he helped lead the effort to defeat ISIS in Iraq and Syria.

LLOYD AUSTIN: WHAT TO KNOW ABOUT BIDEN'S CHOICE FOR SECRETARY OF DEFENSE

Biden built a close relationship with Austin during his vice presidency and said during a December news conference he tapped his friend because "there's no question that he is the right person for this job at the right moment."

Austin tweeted a picture of himself and Biden after his successful confirmation vote.

"It’s an honor and a privilege to serve as our country’s 28th Secretary of Defense, and I’m especially proud to be the first African American to hold the position," Austin wrote. "Let’s get to work."

Austin enjoyed broad support. The only two "no" votes were GOP Sens. Josh Hawley of Missouri and Mike Lee of Utah.

Sen. James Inhofe, R-Okla., the top Republican on the Senate Armed Services Committee, backed Austin for the job. "I am very confident that Lloyd Austin will be a strong, capable civilian leader for the Pentagon at this critical time," Inhofe said.

On Thursday, both the House and Senate cleared the way for Austin's confirmation by passing a waiver to allow Austin to lead the Defense Department as a civilian. Under the law, a retired service member must be out of the military for seven years in order to be named defense secretary, and Austin hadn't been retired long enough. 

HOUSE, SENATE APPROVE CIVILIAN WAIVER FOR BIDEN'S DEFENSE SECRETARY NOMINEE LLOYD AUSTIN

Gen. Lloyd Austin III, then-commander of U.S. Central Command, prepares to testify before the Senate Armed Services Committee about the ongoing U.S. military operations to counter the Islamic State in 2015 in Washington, D.C. (Getty Images) (Getty Images)

Since his retirement from the military, Austin served on the board of Raytheon Technologies, one of the world's largest military weapons and technology manufacturers. Raytheon is a major Pentagon contractor. 

BIDEN’S PICK FOR DEFENSE SECRETARY SUPPORTS OVERTURNING TRUMP’S MILITARY TRANSGENDER BAN

Rhode Island Democratic Sen. Jack Reed, the incoming leader of the Armed Services Committee, backed a waiver for Austin, even though he said he didn't want to support another waiver as he did four years ago for President Trump's nominee James Mattis.

Reed cited the "historic nomination" and the life-threatening dangers facing the world right now. 

"[Austin] will restore direction to a Pentagon that has been left rudderless and adrift for too long under the previous administration," Reed said. "His character and integrity are unquestioned and he possesses the knowledge and skill to effectively lead the Pentagon."

DEMOCRATS WHO OPPOSED WAIVER LETTING MATTIS SERVE AS DEFENSE SECRETARY NOW WANT ONE FOR BIDEN PICK

"We have troops deployed around the world who face life-threatening dangers every day and need leadership and stability," Reed continued. "Our nation is also facing a worsening pandemic and civil unrest. There is no question this confirmation has taken on increased urgency."

Austin is just the second Biden Cabinet pick approved by the Senate. On Wednesday the Senate confirmed Avril Haines as director of national intelligence, whereas Trump had his secretaries of defense and homeland security confirmed by his inauguration. 

During his confirmation hearing, Austin said he would recuse himself from defense matters involving Raytheon Technologies for four years. Austin said he would review the Department of Defense's response to the coronavirus pandemic, including vaccine distribution, and would address white supremacy and violent extremism in the ranks of the military.

Austin promised to "rid our ranks of racists," and said he takes the problem personally.

Austin also assured senators he values the principle of civilian control of the Pentagon.

GET THE FOX NEWS APP

"I know that being a member of the president’s Cabinet -- a political appointee -- requires a different perspective and unique duties from a career in uniform," Austin said during his Senate Armed Services Committee confirmation on Tuesday. "I would not be here, asking for your support, if I felt I was unable or unwilling to question people with whom I once served and operations I once led, or too afraid to speak my mind to you or to the president."

The Associated Press contributed to this report.