WASHINGTON — The suddenly tough battle over Dr. Vivek H. Murthy’s confirmation to become the next surgeon general is a fierce warning from the gun lobby that it will not be taken for granted in this year’s congressional elections.

President Obama’s health care law has dominated the political discussion ahead of this November’s election. Murthy’s advocacy for the health law had also been considered the most controversial aspect of his nomination.

But it is opposition from the National Rifle Association that has forced Obama in recent days to reevaluate his strategy and consider delaying a vote on Murthy, a doctor at Brigham and Women’s Hospital and longtime Obama ally.

The shift in Obama’s strategy — which could be a precursor to scuttling the nomination altogether — comes as Murthy has been the target of criticism by Republicans and some conservative Democrats, after opposition by the NRA.

The lobbying campaign illustrates the muscle of outside groups being able to dim the prospects of a nominee who many initially believed would be confirmed.

“The NRA does a very good job of firing up voters on gun issues, and there are enough [NRA] voters in several states where there are moderate Democrats running for reelection to make a difference,” said Lee Drutman, a senior fellow at the Sunlight Foundation who has studied the effect of gun issues on politics.

Despite recent activism from gun control advocates, there remains little political upside for many politicians in supporting stricter measures.

“In close elections, you don’t want to take a chance by opposing the NRA,” Drutman said.

The position of surgeon general is strictly advisory, providing a health-advocate-in-chief for the administration. But virtually all nominees in today’s toxic Washington environment, regardless of how little power they have, are subject to the ideological battles that have paralyzed the Capitol.

Murthy has been an advocate for the president’s health overhaul law as well as gun control.

A senior White House official told the Globe on Saturday that the president’s team was readjusting its strategy after the defeat of Debo P. Adegbile, who Obama nominated to lead the Justice Department’s civil rights division.

In that case, the White House was caught off guard by the lack of Democratic support after criticism rose over his legal defense of Mumia Abu-Jamal, who appealed a death sentence for killing a Philadelphia police officer.

“Vivek was approved out of committee with bipartisan support, but after the Debo vote, we are recalibrating the strategy around his floor vote,” said the White House official, speaking on the condition of anonymity to discuss internal deliberations. “We expect him to ultimately get confirmed and be one of the country’s most powerful messengers on health and wellness.”

Murthy, a 36-year-old from Brookline, would be the first Indian-American to become the nation’s top doctor if he is confirmed. He declined comment through his employer, Brigham and Women’s, which said he would not provide comments to the media until after his nomination process is complete.

“I cannot think of a better fit for the expertise, charisma, dedication, and passion that describe the ideal version of ‘America’s Doctor,’ ” she added.

His increasingly shaky prospects have been the subject of news reports in recent days, as the NRA has rat-cheted up its opposition.

Republicans have focused on Murthy’s issues advocacy. He founded Doctors for America, a national organization of 16,000 doctors and medical students that has advocated for the Affordable Care Act and gun control.

Because of changes in Senate rules, his confirmation would only require a simple majority. If all Democrats voted in favor, he would be confirmed. But Democrats are worried that senators from conservative states facing reelection will face pressure.

A Senate leadership aide said Saturday party leaders are still trying to figure out how many defections they have. One who has come out publicly as leaning against the nomination is Senator Mark Begich of Alaska.

The NRA is especially influential in the states where Democrats are facing their toughest challenges this year, including Alaska, Louisiana, Arkansas, and North Carolina.

One Republican, Mark Kirk of Illinois, voted in favor of the nomination in committee in February.

The leadership aide said no vote has been scheduled and the White House “is not pushing for a vote in the near future.”

During Murthy’s confirmation hearing last month before the Senate’s Health Education, Labor and Pensions committee, several Republican senators did raise concerns about his positions on gun control and health care.

“The first concern is much of your credential, it seems to me, is a political credential,” Senator Lamar Alexander, a Republican of Tennessee, said during the 90-minute hearing.

He and other senators also questioned Murthy about prior posts on Twitter that criticized politicians who opposed gun control and spoke in favor of requiring employers to provide female contraception under the health law.

“How would you balance what seems to be a fairly partisan side with being objective?” asked Senator Tim Scott, a South Carolina Republican.

Murthy said he believed the surgeon general should focus on areas where there is broad agreement, including prevention of chronic diseases, efforts to curb smoking, and programs to improve diets.He emphasized that he wanted to focus on community health prevention projects, especially combating obesity.

He has the support of the two Massachusetts senators. Senator Elizabeth Warren formally introduced Murthy during his confirmation hearing last month.

“The NRA seems willing to stop at nothing in their efforts to quash any voice calling for sensible gun safety measures,” Senator Edward Markey, the Massachusetts Democrat, said in a statement. “Gun violence is a public health crisis devastating families and neighborhoods in Massachusetts and across the country.”

At least one Republican said during a confirmation hearing that he expected the Brookline doctor would be approved as surgeon general and two others invited him to visit their states.

The committee voted, 13 to 9, to approve his nomination.

But the NRA on Feb. 26 came out strongly against Murthy’s nomination, sending a letter to top senators saying “confirmation of Dr. Murthy is a prescription for disaster for America’s gun owners.”

The NRA has also said it would factor the confirmation vote into its annual rating of individual senators. That move could cause vulnerable Democrats in conservative states to think twice about voting for the nomination.

Senator Rand Paul, the Kentucky Republican, last month put a procedural hurdle on the confirmation by placing a hold on it. Paul cited Murthy’s past political activity.

“I have serious concerns about Dr. Murthy’s ability to impartially serve as ‘the Nation’s Doctor,’ ” Paul wrote in a letter to Senate majority leader Harry Reid. “The majority of Dr. Murthy’s non-clinical experience is in political advocacy.”