The Senate has narrowly confirmed California Attorney General Xavier Becerra as secretary of the Department of Health and Human Services.

The chamber voted 50-49 Thursday to confirm Becerra, who overcame questions from Republicans over his qualifications to lead the health agency and his past moves on abortion policy.

Becerra’s confirmation earned plaudits from several provider groups.

The American Medical Association (AMA) said Becerra will be “tested early as he arrives amid a pandemic and challenges to the Affordable Care Act,” according to a statement.

The AMA added that he is the “right person for the job.”

Other groups lauded Becerra for his work protecting the ACA. Becerra was among several blue states that led a defense of the ACA in a lawsuit that challenged its constitutionality.

“As California’s Attorney General, Becerra was a key defender of the Affordable Care Act (ACA), expressing his support of the law and the protections it provides Americans,” the Blue Cross Blue Shield Association, which represents 35 Blues plans, said in a statement.

Becerra previously served in the House before becoming the attorney general in 2017. He was a primary legal antagonist to the Trump administration, including in his efforts to defend the ACA.

Becerra also reached a major antitrust settlement with Northern California-based hospital system Sutter Health, arguing the system was overcharging its customers. Sutter agreed in 2019 to pay the state $575 million to settle the antitrust allegations.

Becerra’s tenure begins as the federal government has ramped up its efforts to scrutinize hospital mergers. The Federal Trade Commission has launched several antitrust lawsuits over the past year to squash mergers the agency claimed could raise healthcare prices and decrease quality for patients.

But Becerra’s confirmation got major support from hospital groups.

America’s Essential Hospitals said Thursday that it wants to work with Becerra on boosting “support for essential hospitals and underrepresented people and to protect programs vital to our healthcare safety net, such as Medicaid and the 340B drug pricing program.”

Becerra was asked by Sen. Bill Cassidy, R-Louisiana, during his confirmation hearing about the statutory definition for contract pharmacy, a nod to a major feud between hospitals and drugmakers over access to products.

But Becerra said he will only follow the law on the program. He did add that the 340B drug discount program has become an “indispensable program” for some of the providers.