In a 51–44 vote Wednesday, the US Senate confirmed Erica Schwartz as director of the Centers for Disease Control and Prevention, despite failing miserably to convince senators last month that she could stand up to anti-vaccine Health Secretary Robert F. Kennedy Jr.

The confirmation ends a near yearlong vacancy for the position since Kennedy fired the previous CDC director, Susan Monarez, last August. Monarez was ousted after she refused to rubber-stamp vaccine recommendations from a panel of Kennedy’s hand-selected advisors, who hold similar anti-vaccine views to his own.

Schwartz is highly qualified for the role, coming to the CDC with a medical degree, a master’s degree in public health, and a law degree. She previously had a long stint as a Navy officer and held leadership roles including chief medical officer for the US Coast Guard and deputy surgeon general in the first Trump administration. Notably, she has been a public advocate for vaccines and outbreak preparedness.

As such, outside health experts were surprised by her selection and cautiously optimistic about her taking up the role. While Kennedy’s close anti-vaccine ally, Aaron Siri, blasted her nomination over her support for vaccines, those in the health community held out hope that Schwartz could stabilize and restore the flagging agency, demoralized and hampered by harsh staff reductions, budget cuts, and relentless scorn from Kennedy and his political appointees.