The U.S. Senate late Friday night approved Pete Hegseth, President Donald Trump’s nominee for defense secretary, on a mostly party-line, 51-50 vote.

Vice President JD Vance broke the 50-50 tie in the 100-member Senate, casting the deciding vote. It is only the second time in U.S. history that a vice president, who is president of the Senate, had to break a tie for a nominee.

US Senate approves Hegseth as defense secretary by 51-50 vote

The vote followed days of Senate debate over Hegseth’s fitness for the top civilian role in the U.S. military, managing the nation’s armed forces.

US Senate approves Hegseth as defense secretary by 51-50 vote

In his confirmation hearing earlier this month, Hegseth told lawmakers he would bring back accountability to the nation’s military.

US Senate approves Hegseth as defense secretary by 51-50 vote

He received support from Senate Armed Services Committee Chairman Roger Wicker, who said, "Pete Hegseth has the determination and the tools to achieve real change. He will inject a new warrior ethos into the Pentagon, a spirit that can cascade from the top down."

But Hegseth faced criticism from Senate Democrats over his statements about women and transgender people serving in the military, as well as allegations of sexual assault, drunkenness and financial mismanagement of two nonprofits serving U.S. veterans that he led.

Earlier this week, senators received an affidavit from Danielle Hegseth, Hegseth's former sister-in-law, alleging he was abusive toward his second ex-wife, Samantha Hegseth. She did not describe the abuse and said she did not witness it. In a statement to NBC News, which first reported the story, Samantha Hegseth said, "There was no physical abuse in my marriage."

Senator Jack Reed, the top Democrat on the Armed Services Committee, said Thursday he was not satisfied with Hegseth’s answers to his questions about reports that the Trump administration would implement a board to screen senior military officers for their fitness to lead.

"We've seen it happen in other places around the world, where militaries are undermined and subjected by political leaders that have a particular political point of view and passion, and they become essentially not an army but an extension of the political aspirations of the Great Leader. We can't see that here in America," Reed said.

Hegseth, a former television host at conservative Fox News, also served as an officer in the Army National Guard in Iraq, Afghanistan and Guantanamo Bay and is the author of several books.

"I don't have a similar biography to defense secretaries of the last 30 years," Hegseth told senators in his opening statement, "But as President Trump also told me, we've repeatedly placed people atop the Pentagon with the supposed right of credentials, whether they are retired generals, academics or defense contractor executives. And where has it gotten us?"

Republican senators praised Hegseth for his fresh perspective.

"Mr. Hegseth will bring energy and fresh ideas to shake up the bureaucracy. He will focus relentlessly on the war fighter and the military's core missions, deterring wars and winning the ones we must fight," Wicker said during the confirmation hearings.

Hegseth said his priorities would focus on the threat posed by China and defense of the United States, while reorienting the United States away from entanglements in the Middle East. He also pledged to restore morale and end diversity initiatives that he sees as harmful to establishing a merit-based military.

Asked how he sees his role, Hegseth replied, "Getting anything that doesn't contribute to our democracy out of how decisions are made inside the Pentagon. What gender you are. What race you are. Your views on climate change. Your conscience and your faith should have no bearing on whether you get promoted or whether you're selected to go to West Point or where you go to school. Only thing that should matter is, ‘How capable are you at your job? How excellent are you at your job?’"

Hegseth will be the first defense secretary to have served as a junior officer on the front lines, and the first secretary from the generation that fought in post-9/11 wars.

Senate Democrats said Hegseth’s experience running two nonprofits benefiting military veterans, with fewer than 100 employees, was not sufficient experience to run the massive Defense Department.

"We're hiring you to be the CEO of one of the most complex, largest organizations in the world. We're the board of directors here. I don't know of any corporate board of directors that would hire a CEO, that said, you know, 'I supervised 100 people before,'" Democratic Senator Gary Peters said.

The Defense Department oversees more than 3 million service members and a budget of $857 billion.