The Senate on Monday confirmed Denis McDonough as President Biden’s Veterans Affairs secretary, choosing a non-veteran but a manager with years of government service to lead the sprawling health and benefits agency.

McDonough, 51, was chief of staff during Barack Obama’s second term and held senior roles on the National Security Council and on Capitol Hill before that. He told senators at his confirmation hearing that although he is not a veteran, his long career as a behind-the-scenes troubleshooter and policymaker would serve him well at the Department of Veterans Affairs, a massive bureaucracy beset by multiple challenges.

“I can unstick problems inside agencies and across agencies, especially at an agency as large as VA,” McDonough told the Senate Veterans’ Affairs Committee in January.

Before the vote, Senate Majority Leader Charles E. Schumer (D-N.Y.) called VA’s mission to care for veterans “one of organization, institutional know-how, and administrative troubleshooting.”

McDonough’s “decades of experience at the highest levels of government” qualify him for that mission, Schumer said.

McDonough was confirmed on an 87-to-7 vote.

VA, the second-largest federal agency, includes a health-care system that serves 9 million veterans, a vast benefits bureaucracy and dozens of national cemeteries. Management and workforce challenges have long beset leaders in both parties. A scandal over fudged wait-time lists for medical appointments led Obama to fire his first veterans chief.

McDonough succeeds Robert Wilkie, former president Donald Trump’s second VA leader. Under Wilkie, the agency expanded options for veterans to see private doctors outside the government-run system and advanced an ambitious, multibillion-dollar modernization of its antiquated medical records system.

Wilkie’s tenure closed out with a scathing inspector general’s report in December that found he campaigned to discredit a congressional aide who said she was sexually assaulted at VA’s medical center in the District. Wilkie, who left office on Inauguration Day, disputed the findings.

McDonough, a Minnesota native, was Obama’s deputy national security adviser during the Navy SEAL raid in 2011 that killed al-Qaeda leader Osama bin Laden. He was also a longtime congressional staffer, which appealed to senators in both parties who during his confirmation hearing demanded better transparency and communication than they said they got from Wilkie.

His profile in the Obama White House grew around one of the administration’s most ambitious second-term initiatives to counter the wait-times scandal, the Veterans Choice Act. The legislation expanded the ability of veterans to receive private health care. Trump expanded the program with the Mission Act.

McDonough will take over a system that is struggling to ensure that health-care workers and veterans in its care are vaccinated against the coronavirus and receive timely treatment when they test positive for the virus.

Female veterans, the fastest-growing group of former servicemembers, have reported sexual harassment at VA facilities. The electronic records project, which aims to sync veterans’ medical records with Defense Department records from their military service, has run into rollout delays, cost increases and, in recent weeks, major operational glitches at its first pilot site in Spokane, Wash. Labor-management relations in the workforce are at a low point.

And amid a continuing debate over private care, a commission that Congress approved to consider whether underused VA hospitals should close is gearing up to review the system. The effort is likely to tap into political sensitivities in congressional districts about closing hospitals.

“This is not an easy job,” Senate Veterans’ Affairs Committee Chairman Jon Tester (D-Mont.) said before the vote started. In his career in public service, “Denis McDonough has demonstrated he can get the job done, working across agencies and finding common ground,” Tester said. “Veterans need someone like Denis fighting in their corner.”

McDonough is only the second non-veteran to lead VA, following David Shulkin, a physician and former hospital executive who was Wilkie’s predecessor under Trump. Veterans’ groups had pushed for a leader from the post-9/11 era and were caught off guard when Biden nominated McDonough, continuing his pattern of turning to Obama-era staffers for his Cabinet.

McDonough told lawmakers that he got a taste of the veteran’s life on trips to Iraq and Afghanistan while he served in the Obama White House. He said he saw the effects of long deployments on families and regularly visited wounded troops at Walter Reed National Military Medical Center.