Republican lawmakers questioned President Obama’s pick for surgeon general, Vivek Murthy, at a Senate confirmation hearing Tuesday, expressing reservations about the nominee’s past roles as an Affordable Care Act advocate and gun-control proponent.

Murthy, 36, who would be the first Indian American to become chief U.S. doctor, works at Brigham and Women’s Hospital in Boston and is an instructor at Harvard Medical School. If confirmed, he will take over for acting surgeon general Boris D. Lushniak, who stepped in when Regina Benjamin left the post in July.

The nominee was an early supporter of Obama and his health-care legislation, co-founding Doctors for Obama in 2008 and later transforming the group into Doctors for America, which promoted the health-care plan before it became law.

“Much of your work has been devoted to electing the current president and advocating the new health-care law, all of which is your right to do as an American,” said Sen. Lamar Alexander (Tenn.), the ranking Republican on the Senate Health, Education, Labor and Pensions Committee. “But as a public official, if that becomes your principal purpose of the bully pulpit, that gets to be a problem.”

Murthy said that he has never viewed the Affordable Care Act as a perfect solution and that he promoted the plan as a step in the right direction.

He said of his view on surgeons general: “The role is not to be a legislator or a judge. The role is to be a public health educator.”

The nominee said he would focus on issues with broad agreement, including obesity and tobacco-related illnesses, mental-health problems, reducing vaccine-preventable diseases and building community partnerships to “ensure that all institutions in society play a role in prevention and health promotion.”

In addition to the opposition, the health-care law has faced several problems, including the botched rollout of its Web site in the fall and frustration over policy cancellations for Americans whose insurance plans do not meet the law’s requirements.

Despite the early glitches, 3 million Americans had enrolled in plans through federal or state marketplaces as of Jan. 24.

Alexander also raised questions about Murthy’s support for stricter gun control, citing a number of postings on the nominee’s Twitter account. On Oct. 16, Murthy wrote: “Tired of politicians playing politics w/ guns, putting lives at risk b/c they’re scared of NRA. Guns are a health care issue. ­#debatehealth.”

Murthy told the panel that his views on the issue will not come into play if he is confirmed. “I do not intend to use my office as surgeon general as a bully pulpit on gun control,” he said, adding that his position is based on experience treating victims of gun violence.

Asked about his stance on marijuana legalization, Murthy said more research needs to be done about the drug’s impacts before conclusions are drawn.

“Just like other drugs, I don’t recommend marijuana, and I don’t think it’s a good habit to use marijuana,” he said. “If I had kids, I would tell them not to use it.”

Sen. Tom Harkin (D-Iowa), who heads the committee, described Murthy as an “exemplary candidate” for surgeon general. “Should he be confirmed, Dr. Murthy’s calm demeanor, his excellent ability to communicate with Americans from all backgrounds and his medical and public-health expertise will be invaluable assets,” Harkin said.

Murthy, the son of Indian immigrants, holds a bachelor’s degree from Harvard and an MBA from the Yale School of Management. He received his medical degree from Yale. His résumé includes founding Visions Worldwide, a nonprofit group dedicated to HIV/AIDS education, and TrialNetworks, a software company focused on making drug development and clinical trials more efficient.

Murthy said his grandfather was a “poor farmer who fought for democracy and freedom in India,” telling the panel that “he never could have dreamed that his grandson would have the opportunity to sit before you today to be considered for the position of surgeon general.”