Alice Ollstein contributed reporting.

After a dizzying few days of horse-trading and last-minute changes, House Republicans passed their Obamacare repeal bill Thursday, checking off a years-long promise and unexpectedly overcoming an embarrassing false start earlier this year.

The legislation would impose massive cuts to Medicaid, rework the Affordable Care Act, make many of the ACA’s consumer protections optional for state and eliminated many of the law’s taxes, which Republicans say will shore up savings for their tax cut plan.

The vote was 217-213.

“I don’t know if you remember what [then-Vice President Joe] Biden whispered in the President’s ear back when he was signing [the Affordable Care Act],” Rep. Bill Flores (R-TX) asked reporters, referring to Biden’s “this is a big f-cking deal” hot mic moment.

“This is a bigger deal than that,” Flores said before Thursday’s vote.

The process that got House Republicans to this point was a messy one. The bill, the American Health Care Act, was first slated for a vote in March, but was pulled from the floor the day of as GOP leadership faced revolts from both their hard-right and centrist wings. Weeks of further negotiating resulted in an amendment, unveiled last week, to allow states to opt-out of certain ACA insurer mandates, which in turned spooked the GOP centrists. Their support was bought back with another amendment, released late Thursday evening, to provide $8 billion more in funding for pre-existing conditions.

Even still, hours before the vote, some moderate Republicans refused to say whether they would support it.

“This is not ramming it through,” Rep. Morgan Griffith (R-VA), a conservative member of the Energy and Commerce Committee, claimed Thursday morning. “This is a rough and tumble exercise that the Founding Fathers anticipated and we’re doing it the way it’s supposed to be done.”

In fact, the bill went through a curtailed committee process, did not wait for a score from the Congressional Budget Office as to the latest changes’ cost or levels of coverage, and went to the floor before the ink on its latest revisions was even dry. Some Republicans admitted to have not fully read the latest version of the full legislative text.

” I haven’t read the word by word,” Rep. Joe Wilson (R-SC) said Thursday. “I read the other one [Obamacare] word by word, but that was after it passed. By reading a brief you can get the full impact.” Wilson’s office later emailed to say he “misunderstood” the question and “has read the AHCA.”

Thursday’s vote marks President Trump’s biggest legislative accomplishment since coming into office. He stayed mostly removed from the policy specifics, but employed his deputies, including Vice President Mike Pence and Health and Humans Service Secretary Tom Price to do a final round of arm-twisting this week. For Republicans more generally, after seven years of failing to coalesce around a single Obamacare replacement plan, they finally have a piece of legislation they can point to that won the support of one of their conferences.

In a floor speech before the vote, House Speaker Paul Ryan (R-WI) rallied Republicans in a call-and-response:

“Are we going to meet this test?”

“Are we going to be men and women of our word?”

“Are we going to keep the promises we made?”

As they voted, buses waited outside the Capitol to take GOP members to a party at the White House to celebrate the vote. Cases of beer were also spotted by reporters being rolled into the Capitol.

Applause among the Republicans broke out when the vote total hit 216. Democrats, as the time ran out, sang “nah nah nah nah, hey hey hey, good bye.”

House Republicans voted on the bill without an updated Congressional Budget Office score. The last analysis by the nonpartisan agency, conducted in March, showed the bill resulting in 24 million fewer people having health insurance coverage over the next decade than current law, while bringing the government $150 billion in savings. Health experts have warned that the changes since could cost many more their insurance and the funding recently allotted last night would not be enough to subsidize their coverage.

At one point during Ryan’s pre-vote floor speech, as he hailed the bill’s “deliberative” process, a Democratic member heckled him: “Where’s the score?”

While the last week of the negotiations around the bill focused on how it could expose consumers with pre-existing conditions to losing their coverage, the legislation’s far bigger impact stands to be on Medicaid. The GOP plan would begin phasing out Medicaid expansion in 2020, while imposing whats known as a “per capita cap” on the general program. Starting in 2020, states would receive a set amount of money from the federal government per Medicaid enrollee as opposed to the current unlimited match rate. Since the cap will increase at a lower rate than medical inflation, the bill is expected to slash $880 billion over 10 years from the program, according to the CBO’s analysis of the original version of the bill.

The legislation will next travel to the Senate, where House moderates have said they hoped some of the issues they have with the bill’s Medicaid provisions and its weakening of pre-existing condition protections will be addressed. Some House conservatives have warned that if the bill is moved anywhere closer to the center by the Senate, they would oppose it in their final vote on it.

“The bill will change in the Senate,” said House Freedom Caucus Chair Mark Meadows (R-NC), a pivotal conservative in House negotiations who says he’s already spoken 14 senators about the legislation.

“I believe it will get better in most parts but I also believe is that what we’re going to see is that there’s been real work done with individual members of the Senate to hopefully have consensus that happens in a very quick order,” Meadows told reporters before the vote.

Regardless of the next steps, Democrats are already warning that House Republicans’ approval of the American Health Care Act, which polls at 17 percent among the American public, will be a toxic issue for them in the 2018 mid-term elections.

Even Republicans acknowledge the potential risk.

“In 2010 Democrats were not right. We can debate policy, but politically they thought that thing would become popular,” Rep. Tom Cole (R-OK) told reporters Thursday morning. “It didn’t, and it killed them over several election cycles. We run that risk here.”