House Republicans passed a bill on Thursday to repeal and replace ObamaCare, giving President Trump who pledged during the campaign to ditch the healthcare plan his biggest legislative victory in the first months of his presidency.

The GOP-backed American Health Care Act squeaked through by a 217-213 margin – no Democrats voted for repeal and 20 Republicans voted against it – as Republican lawmakers erupted in cheers and Democrats taunted “na, na, na, na, hey, hey, goodbye” as the results came in.

At a celebratory news conference in the Rose Garden about an hour later, Trump was met by rousing applause as he stepped up to the podium – even though the bill has to clear the Senate, where it faces an uncertain future and could undergo radical alterations.

“Make no mistake about it, this is a repeal and replace of Obamacare,” a beaming Trump said. “Yes, premiums will be coming down. Yes, deductibles will be coming down. But very importantly, it’s a great plan and ultimately that’s what it’s all about.” He added. “This has brought the Republican Party together.”

The Republican win came after a full-court press over the last several days by members of the Trump administration, including the president himself, who worked the phones to cajole moderates to support the bill.

‘It’s a great plan and ultimately that’s what it’s all about’ - Donald Trump

Earlier Thursday, House Republican leadership mobilized undecided lawmakers, including playing the “Rocky” theme during a pep rally in the Capitol basement.

Trump said he predicted long ago during his campaign that ObamaCare was on shaky ground.

“I said it’s failing. And now it’s obvious it’s failing,” he said. “It’s dead. It’s essentially dead.”

House Speaker Paul Ryan relished in the victory after having to pull an early version of the AHCA from the floor in March because it failed to gather the support needed to pass.

He said the GOP bill completed a step in the process but it has a way to go before it is signed into law.

“We’re going to see that work through … because the issues are just too important, the stakes are too high,” he said in the Rose Garden. “The problems facing Ameican families are real and the problems facing american families as a result of ObamaCare are too dire and too urgent.”

Mentioning recent reports about how insurers are beginning to abandon ObamaCare marketplaces, Ryan said “this law has failed and it is collapsing.”

“Republicans are committed to keeping our promise to lift the burden of ObamaCare,” he said.

House Minority Leader Nancy Pelsoi said the vote to repeal ObamaCare will come back to haunt Republicans because she predicted it will fail in the Senate, leaving it the responsibility of House GOP members.

​”​They have this vote tatto​oed​ on them. This is a scar they will carry. This is their vote​,” Pelosi (D-Calif.) said. “It’s not the ​S​enate vote and that is really a poor choi​c​e​ – ​a cowardly choice I might add.​”​

​She mocked the Republicans for celebrating the bill that she called a money grab and a transfer of wealth from the middle class to the country’s richest.

“The trickle down crowd is having a beer party in the Rose Garden,” ​she said.

Minutes before the Republican-majority House voted, Trump tweeted that he was monitoring the speeches.

“Watching the Democrats trying to defend the “you can keep you doctor, you can keep your plan & premiums will go down” ObamaCare lie,” he wrote.

Earlier, he had tweeted that former President Obama’s 2010 signature healthcare achievement was in a “death spiral” because insurers were abandoning coverage in marketplaces across the country.

Ryan echoed Trump’s remarks about a doomed ObamaCare, pointing out that the state of Iowa only has one insurer left.

“This isn’t a choice,” he said as he closed out debate on the House floor. “This is a crisis.”

The Republican healthcare plan had been revised since Ryan pulled the bill from the floor in March after more conservative members in the House Freedom Caucus said it didn’t go far enough to outright repeal and replace ObamaCare.

But with provisions aimed at getting those conservative members on board, Republican leaders in the House believed they had the necessary 216 votes to overhaul ObamaCare and scheduled the Thursday vote.

“We will be voting on the health care votes tomorrow. Because we have enough votes. It’ll pass. It’s a good bill,” House Majority Leader Kevin McCarthy told reporters on Wednesday night.

One of the most disputed parts of the AHCA was whether it would continue to cover people with pre-existing conditions.

A new provision added to the Republican plan allowed states to get waivers to drop essential medical benefits mandated under ObamaCare like maternity and outpatient care. As part of that, states would be able to raise premiums for those with pre-existing conditions, creating high-risk pools, in an effort to try to reduce costs.

When some moderate Republicans balked at the lack of coverage of pre-existing conditions, the GOP leaders added $8 billion over five years to fund those high-risk pools.

Democrats opposed AHCA saying it would leave millions of people uninsured and was simply a way for Republicans to set the stage for a huge tax break for corporations and the country’s wealthiest.

According to a Congressional Budget Office estimate from the initial effort to repeal ObamaCare, 24 million Americans will be without healthcare after 10 years.

There was no CBO analysis for the revised plan.