WASHINGTON — The Senate on Thursday confirmed Robert F. Kennedy Jr. and he was sworn in as President Donald Trump’s health secretary, putting the prominent vaccine skeptic in control of $1.7 trillion in federal spending, vaccine recommendations and food safety as well as health insurance programs for roughly half the country.

Nearly all Republicans fell in line behind Trump despite hesitancy over Kennedy views on vaccines, voting 52-48 to elevate the scion of one of America’s most storied political — and Democratic — families to secretary of the Health and Human Services Department.

Democrats unanimously opposed Kennedy.

Kentucky Sen. Mitch McConnell, who had polio as a child, was the only “no” vote among Republicans, mirroring his stands against Trump’s nominees for the Pentagon chief and director of national intelligence.

“I’m a survivor of childhood polio. In my lifetime, I’ve watched vaccines save millions of lives from devastating diseases across America and around the world,” McConnell said in a statement after the vote. “I will not condone the re-litigation of proven cures, and neither will millions of Americans who credit their survival and quality of life to scientific miracles.”

The rest of the GOP, however, has embraced Kennedy’s vision with a directive for the public health agencies to focus on chronic diseases such as obesity.

“We’ve got to get into the business of making America healthy again,” said Sen. Mike Crapo, R-Idaho, adding that Kennedy will bring a “fresh perspective” to the office.

Kennedy — joined by his wife, Cheryl Hines, other family members and several members of Congress — was sworn in Thursday afternoon in the Oval Office by Supreme Court Justice Neil Gorsuch, hours after confirmation.

Kennedy, 71, whose name and family tragedies have put him in the national spotlight since he was a child, has earned a formidable following with his populist and sometimes extreme views on food, chemicals and vaccines.

Kennedy made more than $850,000 last year from an arrangement referring clients to a law firm that has sued the makers of Gardasil, a human papillomavirus vaccine that protects against cervical cancer. If confirmed as health secretary, he promised to reroute fees collected from the arrangement to his son.