WASHINGTON -- Nearly a year after the Senate failed to expand gun background checks as a response to the massacre in Newtown, Connecticut, it looked as though the National Rifle Association had claimed another scalp. Dr. Vivek Murthy, President Barack Obama's pick for surgeon general, had been approved by a Senate committee in late February, only to be engulfed in controversy when a 2012 tweet was uncovered in which he declared guns a "health-care" issue.

Several Senate Democrats facing tough re-election battles in 2014 balked at their president's nominee. Some had already taken a risk by voting for the background checks measure that ultimately failed. Now, with the NRA launching a full-blown campaign against Murthy, they would once again have to take on the politically toxic issue of guns.

Knowing Murthy's nomination would go down if brought to the floor, Senate Majority Leader Harry Reid (D-Nev.) tabled a vote until after the November election. Then, heavy losses for Democrats at the polls left Murthy's fate unclear, even after Congress returned for the lame-duck session.

But in a rare triumph over the NRA, Murthy was confirmed this week and sworn in on Thursday as the first Indian-American surgeon general. For progressives, the moment culminated months of grassroots campaigning that involved a handful of determined senators and a coalition of health care activists, anti-gun violence groups and the Indian-American community.

Murthy's supporters said they never gave up on his nomination, pointing to his qualifications as a Harvard and Yale-educated physician backed by more than 100 national organizations, as well as former health care officials under Presidents Bill Clinton and George W. Bush. The question, according to activists, was not if the NRA was an insurmountable force, but whether enough enthusiasm could be built within the Democratic base to force a confirmation vote.

The lame-duck session offered their only chance, given Democrats could confirm Murthy with a simple majority vote under rules changes enacted by the Senate last year. Once Republicans take control of the upper chamber next year, he would stand no chance, with the GOP opposing not just Murthy's comments on guns, but his advocacy for the Affordable Care Act under a group he co-founded called Doctors for America, formerly known as Doctors for Obama.

The momentum progressives were seeking showed up unexpectedly in early fall. The Ebola outbreak in West Africa began to make global headlines, and chaos ensued when a few cases showed up in the U.S.

"When that occurred, there was a public awakening about the need to have somebody with deep public health and medical knowledge inside the administration who would be able to guide the right approaches," a Senate Democratic leadership aide told The Huffington Post. "A lot of our outside allies used that moment to help drive that message, and ever since that point in time, maintain the pressure on the Senate to confirm Vivek."

The Center for American Progress Action Fund, which administration officials have credited with laying the groundwork on the Murthy nomination, described the Ebola crisis as a "pivotal moment."

"There was an open question as to why there wasn’t a central figure to coordinate the activities and message in response, which made not having a permanent surgeon general problematic," the fund's campaign director, Emily Tisch Sussman, told HuffPost. "The growing amount of awareness around the nomination then stretched to the media, which raised its profile in a way that helped get the word out about the need to get the confirmation done soon."

Dr. Ravi Jahagirdar, president of the American Association of Physicians of Indian Origin, said the panic over Ebola intensified his group's involvement in campaigning for Murthy.

"There was no direction. It was a sorry spectacle that should not have happened and should not happen again," Jahagirdar told HuffPost in an interview, referring to the Ebola scare. "That's why there was an urgency of appointing someone immediately."

Once the Senate returned to session in November, Reid was adamant with his caucus that a vote on Murthy was forthcoming, win or lose, according to a leadership aide. With several red state Democrats still on the fence, a group of senators quickly went to work trying to persuade colleagues.

Sens. Chris Murphy and Richard Blumenthal, both Democrats from Connecticut whose constituents faced the 2012 tragedy at Sandy Hook elementary school, stood with health care professionals at press conferences calling for a vote and criticized the politics surrounding Murthy's nomination on the Senate floor.

Sen. Elizabeth Warren (D-Mass.) raised the issue during a caucus meeting and pushed for a vote, while Senate Majority Whip Dick Durbin (D-Ill.) helped build support. Endorsements from Virginia Sens. Tim Kaine and Mark Warner, both influential moderate Democrats, also played a key role.

Outside groups sought to make the nomination inescapable.

Health care professionals visited senators' offices and launched a social media campaign, using the hashtags #TopDocNow and #StandWithVivek to refocus attention on the nomination. The anti-gun violence coalition used its infrastructure, which has grown considerably since Newtown, to pressure lawmakers still reluctant to pick a battle over guns.

Americans for Responsible Solutions, the anti-gun violence group launched by former Rep. Gabby Giffords (D-Ariz.) and her husband Mark Kelly, said it collected 29,879 signatures on a petition in Murthy's favor and urged supporters on social media to press their senators. A spokesman for the group said supporters made more than 4,000 calls to senators and sent 7,893 faxes to lawmakers' offices.

Former New York Mayor Michael Bloomberg's Everytown for Gun Safety also encouraged members to contact their senators, and said its lobbyists were involved in discussions on Capitol Hill.

The Indian-American community, not known for exercising political power, rallied behind one of their own. Jahagirdar said it was a telling moment for the demographic, which often sits on the sidelines of politics and is thus not viewed as a major voting bloc.

"Our diaspora plays by the rules, and we really deserved to have a candidate who is one of us up there," Jahagirdar said. "We should be viewed as good citizens and get the reward for such, too."

Murthy, who said he plans to focus on obesity and chronic disease rather than guns, personally sat down with lawmakers on both sides of the aisle to make his case. His appeal paid dividends, as Sens. Jon Tester (Mont.) and Mark Pryor (Ark.), key red state Democrats, publicly came out in his support in a key point leading up to the vote. Advocates said their strategy was to frame their message around public health and shift the focus away from guns.

When Murthy's nomination finally reached the Senate floor on Monday, aides said they were confident the votes to confirm him were there, so long as members turned up.

Pressure nonetheless loomed from the NRA, which said it would score the vote for future political campaigns. Doctors donning their white coats nervously watched from the Senate gallery as Republicans spoke out against Murthy's nomination on the floor.

In a final appeal to their colleagues, Blumenthal and Murphy asked what about Murthy's statements on gun violence was inaccurate.

"The simple fact is gun violence impacts far too many people, it destroys far too many lives," Blumenthal said.

"Dr. Murthy is right. Gun violence is a problem that this country should be addressing," Murphy said. "If we can’t even get to the point where we all agree on that general notion … then maybe this is more hopeless than I thought."

Murthy was ultimately cleared by a vote of 51-43, prompting cheers and applause from his supporters in the gallery. The NRA didn't return a request for comment on his confirmation.

Dr. Christopher Lillis, an internal medicine physician who sat on the board of Doctors for America, celebrated the result while criticizing the political reasons behind the delay.

"I think it was infuriating, because what Dr. Murthy said in the wake of the Sandy Hook killings was not different than what any other physician organization has come out and said publicly," Lillis told HuffPost.