The Senate voted 72 to 18 to confirm Dr. Stephen Hahn as commissioner of the Food and Drug Administration, as the agency faces pressure to reduce teenage vaping and weighs competing interests on a long-delayed proposal to ban flavored e-cigarettes.

Dr. Hahn, chief medical executive at the University of Texas M.D. Anderson Cancer Center, was nominated by President Trump to replace Dr. Scott Gottlieb, who left the post in the spring. Since then, the F.D.A. has been run by two acting commissioners.

In two recent appearances before the Senate Committee on Health, Education, Labor and Pensions, Dr. Hahn, 59, sidestepped questions on whether he supports the F.D.A.’s proposal to ban most flavored e-cigarettes. Although President Trump promised to do so in September, he has since backed away from that plan, flummoxing public health lobbyists and industry executives alike.

Under tough questioning by Democrats, Dr. Hahn said repeatedly that he would use the best science to make regulatory decisions. But he stopped short of saying whether he supported the agency’s original proposal.