Lloyd Austin made history Friday by becoming the first Black man ever to be appointed as Secretary of Defense, but his path was impeded by a controversial waiver process.

The former four-star Army general helped lead the fight against the Islamic State while serving as the head of U.S. Central Command. Retired since 2016 after more than 40 years of service, the Senate voted to confirm his nomination as the Secretary of Defense by a 93-2 vote.

He had to get a waiver, however, to serve as the head of the Pentagon.

“A person may not be appointed as Secretary of Defense within seven years after relief from active duty as a commissioned officer of a regular component of an armed force,” a law from 1947 reads.

The rule is meant to ensure that only a civilian can lead the Pentagon. Michele Flournoy, a former Defense Department official who never served in the military, was an early name for Biden's pick to lead the department.

Rep. Jim Banks, R-Ind., who sits on the House Armed Services Committee, expressed early opposition to awarding a waiver for Austin. He told Politico that his vote for a waiver for Jim Mattis when he was nominated for the Pentagon job four years ago was “a mistake.”

Arnold Punaro, a retired Marine, told Defense News in November there was a general concern that there were "far too many retired military serving in key political appointments in the Pentagon right now." Mattis was retired only four years when former President Donald Trump nominated him as Secretary of Defense.

Conservative members of the Republican Party also circulated a memo saying that Austin lacked experience “in great power competition and in civilian policy debates," Politico added.

Like the confirmation vote in the Senate, his waiver passed in the House with overwhelming bipartisan support, by a vote of 326-78. Praising the vote, Rep. Adam Smith, D-Wash., the chairman of the House Armed Services Committee, said Lloyd was deeply qualified for the job.

“Our country faces a myriad of national security challenges, and President Biden deserves the cabinet of his choosing as his administration seeks to address these challenges,” he said in a statement on Thursday.

On Friday, Biden ended the controversy by signing a House resolution into law that "provides an exception to a restriction on appointing a Secretary of Defense who, within the past seven years, had been on active duty in a regular component of the armed forces."

Austin on Twitter posted a picture of himself with President Biden.

“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,” he said. “Let’s get to work.”

Retired general Lloyd Austin has been confirmed as the first African American defense secretary
Retired general Lloyd Austin has been confirmed as the first African American defense secretary POOL / Greg Nash