The Republican-sponsored American Health Care Act (AHCA) passed the U.S. House 217-213 Thursday, with one vote to spare, although it will face an uncertain path in the Senate.
No Democrats voted for the bill, and 20 Republicans voted against it. The bill largely repeals and replaces Obamacare.
House GOP leaders expressed confidence earlier that the bill would indeed pass.
"This will pass," House Majority Leader Kevin McCarthy, R-California, told reporters as he left a closed-door meeting with the House Republican Conference. House Majority Whip Steve Scalise, R-Louisiana, also seemed confident that the bill would pass.
The upbeat mood ahead of the key vote comes after weeks of trying to revive their original version of the bill, which failed to win enough support in March and had to be pulled from the floor. Republicans, however, have since made several revisions to the measure -- with the latest one made on Tuesday after skeptical members met with President Trump at the White House. Rep. Fred Upton, R-Michigan, proposed an amendment to the bill that would add $8 billion over five years to cover insurance for people with pre-existing conditions. The addition appeared to sway members who previously opposed the bill, as well as those who were undecided.
"I like the Upton amendment," Rep. Lou Barletta, R-Pennsylvania, told reporters after huddling with his colleagues Thursday. "Actually, it puts more money in the high-risk pools for those with pre-existing conditions, and the fact of the matter is those with pre-existing conditions would have no insurance because the Affordable Care Act is going to totally fail."
Other GOP lawmakers said that their plan was a much more sustainable alternative to Obamacare.
"This is about delivering much more affordable healthcare in contrast to a collapsing Obamacare," said Rep. Kevin Brady, R-Texas, chairman of the powerful tax-writing House Ways and Means Committee. He added that it "creates momentum for tax reform" and takes $1 trillion of tax hikes out of the economy that he said have been hurting patients and small businesses.
For weeks, Speaker Paul Ryan, R-Wisconsin, insisted that the bill would only come to the floor when Republicans had the votes to pass it. They can only afford 21 defections, assuming all Democrats vote against it. Rep. Dan Newhouse, R-Washington, will miss the AHCA vote, his office confirmed to CBS News. He's out of town due to a family emergency. This means that Republicans can afford 21 defections.
After huddling Wednesday night, House GOP leaders decided to move forward and schedule the vote for Thursday afternoon, despite the lack of score from the nonpartisan Congressional Budget Office (CBO), which estimates how it would affect the federal deficit and Americans with health insurance. The CBO’s score of the original bill estimated that 24 million people would lose their insurance over the course of a decade.
Asked about the concern that the final bill hasn't been scored, Rep. Chris Collins, R-New York, said, "We have the score on the base bill that saves billions and billions of dollars."
Collins, the first House member to endorse Mr. Trump during the 2016 campaign, said that while the original CBO score showed it would reduce premiums and save money, he doubted its prediction about 24 million people losing their coverage.
"I don't think there was any accuracy in that," he said. "This isn't a tough vote. This is a vote we promised America. This is living up to our promise to repeal and replace Obamacare which is failing minute by minute and day by day."
But some, like South Carolina Republican Sen. Lindsey Graham, still expressed concern.
The bill would, among other things, repeal the individual and employer mandates put in place by Obamacare that has required people to carry insurance or face a tax penalty, it would provide refundable tax credits to help people afford coverage, expand health savings accounts and phase out an expansion of Medicaid.
Health and medical advocacy groups have slammed the legislation through all of its forms. The president of the American Medical Association, Andrew W. Gurman, warned Wednesday "millions of Americans will lose their health insurance as a direct result of this proposal."
Meanwhile, the chairman of the Freedom Caucus, Rep. Mark Meadows, R-North Carolina, said he's looking forward to what the Senate will produce.
"It'll come back even better, and that we'll get it passed and finally lower premiums for the American people," he said. "I've talked to over 14 different senators on this subject and I'm very optimistic that we'll find some common ground.
CBS News' Walt Cronkite contributed to this report.
© 2017 CBS Interactive Inc. All Rights Reserved.