By Louise Radnofsky, Wall street Journal–

President Donald Trump blamed Democrats for the defeat of his bid to overturn the 2010 Affordable Care Act and enact Republican policy in its place. In some ways he may have been right.

Supporters of the health law popularly known as Obamacare launched an all-out campaign for its survival, keeping Democrats unified in opposition to its repeal, and identifying and exploiting Republican divisions that ultimately forced GOP leaders to pull the bill at the eleventh hour Friday.

In every corner were top officials from former President Barack Obama’s administration, reeling from an election that put their party out of government and left them with plenty of free time on their hands.

Many of the pro-Obamacare campaigners credit House Democratic leader Nancy Pelosi and Senate Democratic leader Chuck Schumer with holding that line, which required GOP leaders to find a majority among their own fractious caucus. But former administration officials regularly headed to Capitol Hill to counsel anxious Democrats about the reasons they should resist any repeal plan.

And it was former leaders from the Obama White House, Department of Health and Human Services and Centers for Medicare and Medicaid Services who worked on many parts of the successful behind-the-scenes campaign to chip away at the GOP majority, tapping old relationships, data and experience of the bitter passions sparked by a health-policy debate to keep Republicans’ rifts fresh.

Together, they worked the Republican governors, who were lukewarm to the GOP bill, and the centrist Republicans from swing districts, many of whom withheld support from the bill last Friday and contributed to its withdrawal from the House floor.

“It’s like breathing for a number of these people,” said Chris Jennings, a Democratic health-policy consultant who served in the Clinton and Obama White Houses, of his colleagues’ work. “They are huge assets who are being tapped. It has been their lives and they know the policy, process and politics inside out.”

Within hours of Mr. Trump’s win, Ron Pollack, the head of the pro-ACA Families USA advocacy group, called a webinar of allied organizations. “We need to organize, not agonize,” he urged. They formed the Protect Our Care coalition and asked Leslie Dach, a former senior counselor to Health and Human Services Secretary Sylvia Mathews Burwell and campaign adviser to Hillary Clinton, to head it.

Other senior figures called and texted one another, exchanged ideas, and provided updates on what they were doing after they cleared out their desks. Many of their key assistants followed them, deferring finding “real jobs” for weeks or months.

Jeanne Lambrew, who ran much of the health law’s implementation from HHS and then the White House, wrote analyses warning of the pitfalls of Republican ideas, some of which she said had been tried by the Obama administration and found wanting.

Andy Slavitt, who had headed the Centers for Medicare and Medicaid Services until Jan. 20, crisscrossed the country to raise misgivings among Republican governors who had opted to expand their Medicaid programs under the health law. GOP-led states had split down the middle over the issue during the Obama administration; now it left them pitted directly against each other over the future of hundreds of billions of dollars.

Mr. Slavitt had been part of the team that turned around, the beleaguered website that had almost brought down the health law in the fall of 2013, and relished chances to do things others said would be impossible. “I’ll drop whatever the hell I’m doing” to defend Medicaid and the health law again, Mr. Slavitt said after the victory.

Former Health and Human Services Secretary Kathleen Sebelius, who had been governor of Kansas, supplemented the message. She was talking to officials in Republican states that, like hers, didn’t expand Medicaid. She told them that they too faced significant downsides from any capping of federal funding for the program.

Right until the end, GOP governors never agreed on a solution; some were openly arguing against the congressional plan bill, others signed onto last-minute letters of muted support.

At Protect Our Care, Mr. Dach was joined by Lori Lodes, the communications director for the Centers for Medicare and Medicaid Services who had left for Mrs. Clinton’s campaign, and several other former administration aides among the group’s staffers and consultants.

Former HHS spokeswoman Meaghan Smith led work on the project at SKDKnickerbocker, the Democratic public affairs firm, which included producing around $5 million of television advertisements run on behalf of unions and other pro-ACA groups.

The groups agreed on a strategy aimed initially at Republican senators in states such as Arizona, Alaska, Maine, Nevada and Tennessee, where fragile insurance markets and state decisions to expand Medicaid and sign up hundreds of thousands of residents had left their senators wary of aggressive or sudden moves.

Print and television ads funded by the Alliance for Healthcare Security, a coalition of unions and other liberal groups, told those senators they were taking “a big risk—like walking off an unfinished bridge.” The senators’ unease initiated a standoff with conservatives demanding full and fast repeal, which Senate leaders tried and failed to resolve for months.

It was a former Obama administration official who told Protect Our Care that the House vote was in play, too. The official, who had worked closely with members of Congress for years, noticed that nine Republicans had balked at an early vote in January to initiate the GOP repeal bill—four centrists, and five conservatives.

Nine defections, the ex-official reasoned, wasn’t so far from the 21 that would undo the entire effort. The official drew up a list of centrist Republican targets who could be flipped—based on voting records, district dynamics and past behavior—in states like New Jersey, New York, Pennsylvania, Ohio and Florida. Some activists saw the House as an opportunity to slow the passage of the bill and damage it in the process; few believed they could stop it entirely.

Research by longtime Democratic pollster Geoff Garin, and other focus groups, helped the campaign hone attacks. The ensuing ads, messages to members of Congress’ town halls and offices, story pitches and official quotes often highlighted individuals who stood to lose care.

In the wake of a Congressional Budget Office analysis of the bill, messaging shifted to drive unease over the idea that insurance premiums would initially go up under the GOP plan, and that people in their 50s and 60s might pay more, even as millions of people lost coverage and the wealthiest benefited from tax cuts.

Party icons were deployed sparingly, to avoid helping Republicans unify in opposition to them, strategists say. But in the final days, Mr. Obama, former Vice President Joe Biden and Mrs. Clinton also helped rally Democrats across what became the finish line.

Mrs. Clinton sent a taped message of support to a gala honoring Mr. Pollack of Families USA on Tuesday. Health policy activists who attended said they left invigorated. Blocks away, Mr. Trump was at a fundraising dinner for House Republicans, demanding they support him.

At Mrs. Pelosi’s request, Mr. Biden led a rally of House Democrats against the GOP bill on the steps of the Capitol Wednesday, to chants of  “Joe! Joe! Joe!” Mr. Biden called the Republican plan a tax cut for the wealthy. “The American public is not going to put up with this,” he said.

Afterward, a young woman came up to the former vice president to thank him for his service. “We can make it,” she said. Mr. Biden cupped her face in his hands and said, ”We’re going to make it.”

On Thursday, the seventh anniversary of the signing of the Affordable Care Act, Mr. Obama issued a rare, but lengthy, public statement.

“The Affordable Care Act is law only because millions of Americans mobilized, and organized,  and decided that this fight was about more than health care—it was about the character of our country,” it concluded. “This fight is still about all that today. And Americans who love their country still have the power to change it.”

The following night, former colleagues were rushing out for cocktails and scheduling impromptu parties that lasted into the weekend. A ‘Save My Care’ sign in the coalition office space had been changed to read ‘Saved My Care.’ Mr. Dach said he enjoyed the evening news for the first time in months, and the next morning, gazed at the Newseum’s collection of newspaper front pages from around the country.

“Democrats are smiling in D.C.,” Mr. Trump tweeted Sunday.