President Trump and House Speaker Paul Ryan led the Rose Garden celebration, but the Freedom Caucus came out of Thursday's healthcare vote big winners.

The group of conservative lawmakers had been derided as an obstacle to Republican unity, good only for killing legislation or forcing it to be passed with Democratic votes. But this time, the Freedom Caucus was instrumental in shaping a bill partially repealing Obamacare that could get to a majority in the House with only Republicans.

"I think they ultimately made the bill better," Rep. Mark Sanford, R-S.C., told the Washington Examiner about his fellow conservatives' Obamacare efforts. "I think the trajectory of the bill has been changed in regard to real world savings in the individual marketplace, which I think will be very important not only from a political standpoint but from a policy standpoint as well."

Trump himself blamed the Freedom Caucus for the initial failure of the Republican Obamacare replacement plan, suggesting they would need to be fought alongside the Democrats in 2018. On Thursday, the president sang their praises.

"The groups have all come together," Trump said at the White House. "We have the Tuesday Group — we have so many groups. We have the Freedom Caucus. We have — and they're all great people."

Only one Freedom Caucus member voted against the latest version of the American Health Care Act, while over a dozen centrists and Republicans from swing districts voted no. Even Rep. Justin Amash, R-Mich., a leading libertarian lawmaker, voted yes.

"Tough vote today," Amash tweeted. "I decided only after I had read and understood the entire bill. A lot of exaggeration from both parties about its effects."

By contrast, there were reports that the centrist Tuesday Group was mulling the expulsion of the member most crucial to achieving a breakthrough on healthcare negotiations: Rep. Tom MacArthur, R-N.J.

Sanford pointed out that Trump said he was "moving on" after Obamacare repeal failed the first time around, after leadership pulled the bill from the House floor, while Freedom Caucus chairman Mark Meadows, R-N.C., kept trying to negotiate with centrists.

"[T]hen you have Meadows and MacArthur begin to kick ideas around and form their amendment that I think resuscitated this bill," he said. "Executive branch is always important but I think that the real credit in this one belongs to a lot of rank-and-file members who rolled up their sleeves and said, 'This issue is too big to be abandoned and it's too important in people's lives and we have to work on it.' So they did."

"I think the lesson here is that the White House should work with conservatives right out of the gate," said a Freedom Caucus source. "You can't ignore conservatives in the Trump era."

The initial argument within the Republican conference was that Freedom Caucus members mostly held safe seats while the centrists were taking all the political risks. A GOP strategist complained about centrist Rep. Charlie Dent, R-Pa., having to "walk the plank" for members winning 70 percent of the vote in their re-election races.

Over time, however, Freedom Caucus members made a variety of concessions to bring other Republicans on board. They moved away from full repeal, backed off their opposition to refundable tax credits, lowered the number of Obamacare mandates they insisted on rescinding from 12 to two, and then accepted allowing states to apply for waivers allowing them to opt out of the mandates.

As centrist vote totals fluctuated, it became difficult to sustain the argument that conservatives were the ones moving the goalposts. "We've moved them much closer," Meadows said after the Obamacare push stalled the first time. "All they have to do is kick a chip shot."

The core conservative argument remained the same: allow the sale of bare-bones insurance plans to lower premiums and bring more young, healthy people into the marketplace. "Our main goal, our only goal, is to lower premiums," Meadows said.

Not everyone was pleased with the group's sudden pragmatism. "Why are Freedom Caucus members, who only yesterday were opposing the lousy budget agreement to increase federal expenditures, chucking their principles aside for a flawed bill they probably haven't read?" asked Reason magazine's Matt Welch. He attempted to answer his own question: "The truth is that Donald Trump generally inspires more positive passion in GOP-held congressional districts than the local congress-critters themselves."

Many grassroots conservatives despise the bill even its current form. So do some holdout lawmakers.

"I voted against this bill not because it's imperfect, but because it's not good," said Rep. Thomas Massie, R-Ky., in a statement. Massie previously compared the bill to a kidney stone that House only cared about passing.

"Now in 2017, for reasons I cannot understand, instead of moving a bill to repeal Obamacare and replace it with reforms that will fix our broken health care system, the Washington Republican leadership jammed a bill through the House that does neither," said Rep. Walter Jones, R-N.C. "Furthermore, the rushed, behind-closed-doors process they've used is shameful."

Lots of last-minute horse-trading was involved in passing the bill, which some supporters admittedly didn't read and the Senate isn't even going to vote on as written.

Still, Freedom Caucus support helped get outside conservative groups to drop their American Health Care Act opposition. And conservative lawmakers were happy to keep even partial Obamacare repeal alive.

"I think it's important to recognize this vote for what it is: a vote to continue the conversation about where we go next on healthcare," Sanford said.

Some even think this is a model for passing future legislation.

"The president cares about how his base responds to policy on Capitol Hill and more often than not that base is going to be aligned with the demands of House conservatives," the Freedom Caucus source said. "If he wants to keep his base happy, he should start by working with conservatives, then make concessions to get enough moderates on board. Not the other way around."

"And this exercise showed us that the Freedom Caucus is willing to stick to its guns," the source added.

Kimberly Leonard contributed to this report.