Washington (CNN) The House will vote Thursday on the Republican bill to repeal and replace Obamacare, setting up a dramatic moment that could give President Donald Trump the significant legislative victory he's been seeking.

Top Republicans are very confident. Majority Leader Kevin McCarthy emerged from Speaker Paul Ryan's office Wednesday night all but triumphant.

"We will be voting on the health care votes tomorrow. Because we have enough votes. It'll pass. It's a good bill," McCarthy, R-California, told a scrum of reporters gathered outside.

Peppered with questions, McCarthy responded enthusiastically: "We're gonna pass it. We're gonna pass it. Let's be optimistic about life!"

The dramatic and long-awaited announcement put to an end a flurry of speculation on Wednesday about whether the Republican health care bill would come up on the House floor for a vote -- or collapse one more time in another embarrassment.

An eleventh-hour deal announced earlier in the day renewed momentum as leaders furiously lobbied undecided or skeptical lawmakers on the plan that had been teetering on the brink of collapse.

The bill advanced out of the Rules committee Wednesday night. House leaders have continued to make clear that if everything goes their way, their preference was to have a vote Thursday. But they were also insistent: They would not call a vote unless they believed it would pass.

Vice President Mike Pence had spent hours on Capitol Hill Wednesday, while members were seen walking in and out of the speaker's office all day.

White House Chief of Staff Reince Priebus told Gloria Borger he is "optimistic" about the outcome.

A notable change in mood came after GOP Reps. Fred Upton and Billy Long met with President Donald Trump at the White House and flipped their votes from "no" to "yes." Trump committed to backing an amendment spending $8 billion over five years to fund high-risk pools and go toward patients with pre-existing conditions.

In the search for votes, the focus has been almost entirely on moderate lawmakers concerned that the GOP bill will erode too many protections in the Affordable Care Act. Democrats, however, will make the case the bill is far too extreme, no matter what tweaks are made in the end.

As originally introduced, the bill would leave 24 million fewer people insured by 2026 than under Obamacare, the non-partisan Congressional Budget Office said.

There will not be a new CBO report before Thursday's vote on the legislation.

House Minority Leader Nancy Pelosi blasted the bill and decision to vote Thursday.

"Forcing a vote without a CBO score shows that Republicans are terrified of the public learning the full consequences of their plan to push Americans with pre-existing conditions into the cold," Pelosi said in a statement. "But tomorrow, House Republicans are going to tattoo this moral monstrosity to their foreheads, and the American people will hold them accountable."

Importantly, the House Freedom Caucus, a group of conservatives who helped scuttle the previous bill in March, now supports the legislation. And it continued to back the bill Wednesday, even with the new spending being added.

Freedom Caucus Chairman Mark Meadows said only one member of the group opposes the bill. "We're not going to lose any votes because of it," he said.

Around the same time that Upton and Long unveiled their moves to "yes," their colleague, Rep. Carlos Curbelo of Florida, declared on Twitter that he opposed the bill.

"I just reiterated to @HouseGOP leaders that #AHCA in its current form fails to sufficiently protect Americans with pre-existing conditions," Curbelo said.

New Jersey Rep. Leonard Lance, a moderate Republican opposed to the bill, also told CNN Wednesday morning that Upton's proposed change would not sway him to support the health care legislation. Lance also noted that he has not heard from Trump or Pence in several weeks.

Moderate Reps. Charlie Dent, Frank LoBiondo and Jaime Herrera Beutler say they still oppose the bill even with the Upton amendment.

Full-court press from Trump

The White House is in a full-court press to rally GOP support. Trump and House leaders failed last week to garner enough support to hold a vote on the bill ahead of the President's symbolic 100th day in office.

The President called about a dozen wavering Republican lawmakers throughout the day Tuesday, urging them to back the bill, a White House official said.

Upton and Long were joined by GOP Reps. Greg Walden and Michael Burgess in their meeting with Trump Wednesday morning.

Upton had rocked Capitol Hill Tuesday by publicly coming out against the GOP health care bill.

His amendment would add $8 billion over five years to fund high-risk pools and go toward patients with pre-existing conditions in states that seek waivers under the Republican legislation. The measure already included $130 billion in the fund.

How to handle coverage for Americans with pre-existing conditions has been a struggle for Republicans seeking to fulfill their longstanding desire to repeal Obamacare. A major pillar of the law is the ban on insurance companies from discriminating against people based on their past medical conditions.

For decades prior to the enactment of the Affordable Care Act, many Americans were unable to even afford or obtain insurance because of their past medical history. As Obamacare has shifted that norm, Republicans have grown increasingly careful in recent years to say they would not repeal protections for people with pre-existing conditions, wary of being branded the party that wants to take that protection away.

High-risk pools

High-risk pools have long been a favorite tool of Republicans, but they have a very checkered past. They were typically severely underfunded, charged participants high premiums, excluded coverage of pre-existing conditions initially and had waiting lists for enrollment.

Some 35 states ran high risk pools prior to Obamacare. In 2011, states had to kick in $1.2 billion to cover 226,000 people enrolled in the programs.

Upton's plan likely wouldn't make much of a difference.

"You just aren't going to cover many people with $8 billion over five years," said Karen Pollitz, senior fellow at the Kaiser Family Foundation.

What's in the bill?

The GOP health care bill would eliminate Obamacare taxes on the wealthy, insurers and others, and get rid of the individual mandate imposed by Obamacare, officially known as the Affordable Care Act. Instead of the Obamacare subsidies that are tied to income and premiums, the GOP plan would provide Americans with refundable tax credits based mainly on age to purchase health insurance.

The legislation would also allow insurers to charge higher premiums to those in their 50s and early 60s, compared to younger consumers.

It would also significantly curtail federal support for Medicaid and allow states to require able-bodied adults to work. After 2020, states that expanded Medicaid would no longer receive enhanced federal funding to cover low-income adults, and those that hadn't expanded would be immediately barred from doing so.

And it would allow states to relax some key Obamacare protections of those with pre-existing conditions, which are among the health reform law's most popular provisions. States could apply for waivers to allow insurers to offer skimpier policies that don't cover the 10 essential health benefits mandated by Obamacare. Also, insurers would be able to charge higher premiums to those with medical issues if they let their coverage lapse. States requesting waivers would have to set up programs -- such as high-risk pools -- to protect insurers from high-cost patients.

However, the GOP bill doesn't touch one another beloved piece of Obamacare -- letting children stay on their parents' insurance plans until the age of 26.