An angry President Trump is pivoting to his tax-cutting plan after slamming Democrats for yesterday’s collapse of an Obamacare replacement bill, predicting the defeat will come back to haunt a giddy Minority Leader Nancy Pelosi when the nation’s health-care system collapses.

“We’ll be going right now for tax reform, which we could have done earlier,” Trump said. “Remember this: We had no Democrat support. So now we’re going to go for tax reform, which I’ve always liked.”

The stunning defeat of the Republican-backed American Health Care Act followed a feverish week on Capitol Hill, where Trump and House Speaker Paul Ryan scrambled to shore up support, only to fall short of the 216 votes needed to repeal and replace Obamacare.

Trump said he did not blame Ryan — “I like Speaker Ryan. … I think Paul really worked hard” — but the crushing setback places the speaker’s future in jeopardy. Ryan was the one who withdrew the GOP legislation, putting in doubt his ability to deliver the goods.

State Rep. Geoff Diehl (R-Whitman), who is mulling a run against U.S. Sen. Elizabeth Warren and was an early Trump backer, said, “There has already been a question of his leadership, but it’s a teachable moment. I would think there are House Republicans who were adamant on seeing the new law better reflect their district’s values.”

Hours after he rushed to the White House to tell Trump he didn’t have the votes to push the bill to the floor, Ryan told reporters, “Moving from an opposition party to a governing party comes with growing pains, and, well, we’re feeling those growing pains today.”

Obamacare, as a result, would remain “the law of the land for the foreseeable future,” Ryan said.

And that means premiums will keep on skyrocketing in some states and coverage will shrink — it’s already at dangerous levels in states like Tennessee and Arizona.

“Best thing we can do, politically speaking, is let Obamacare explode. It’s exploding right now. … Almost all states have big problems,” the president said from the Oval Office.

The Republican bill, produced largely behind closed doors and then amended on the fly, rubbed moderates the wrong way because they said it would leave many voters uninsured — 24 million, by the Congressional Budget Office’s score.

Many conservative Republicans, meanwhile, weren’t swayed despite a late addition that would have repealed former President Barack Obama’s requirement that insurers cover several specified services, such as emergency room services and maternity. Republicans had also sought to eliminate unpopular fines on those who do not obtain coverage.

It’s unclear when Trump’s tax plan will surface, though Treasury Secretary Steven Mnuchin said in a separate interview earlier yesterday that it would come “very soon.”

“Health care is a very complicated issue,” Mnuchin said. “In a way, tax reform is a lot simpler.”

Gleeful Democrats trumpeted their own victory. After hearing that Trump blamed her party for the bill’s defeat, Pelosi wryly noted, “We’ll take credit for that.”

“This was more than an act of resistance. It was our proud first round in the defining battle of the Trump Era,” Bay State U.S. Rep. Joseph Kennedy III, who had taken on a visible role fighting the bill, said in a statement.

“Today we earned victory. Tomorrow we prepare for the fight to come.”

Herald wire services contributed to this report.