Mr. Trump, in a telephone interview moments after the bill was pulled, blamed Democrats and predicted that they would seek a deal within a year, he asserted, after “Obamacare explodes” because of high premiums.
He also expressed weariness with the fight, which was a fraction of the length of time that Democrats devoted to enacting the Affordable Care Act.
“The best thing that could happen is exactly what happened — watch,” he said. “It’s enough already.”
Paul D. Ryan, the House speaker, said, “We are going to be living with Obamacare for the foreseeable future,” after Republicans decided to pull the bill repealing Obamacare in a blow to President Trump.
By ASSOCIATED PRESS. Photo by Gabriella Demczuk for The New York Times. Watch in Times Video »But the effort to win passage had been relentless — and hardly hidden. Vice President Mike Pence and Tom Price, the health secretary, rushed to Capitol Hill for a late appeal to House conservatives, but their pleas fell on deaf ears.
And in private, Mr. Trump took a much harder line. The president was furious that members of the hard-line conservative Freedom Caucus had opposed the legislation. He demanded for much of Thursday that Mr. Ryan push a vote to publicly expose the members who were opposing the administration.
Mr. Trump and his top strategist, Stephen K. Bannon, wanted to see a confidential list to exact revenge on the bill’s Republican opponents, according to two people with direct knowledge of the situation
The critical moment — when the parties decided to withdraw the doomed measure — came during a 3 p.m. phone call with Mr. Ryan and the president, who was in the Oval Office. Mr. Ryan told Mr. Trump that scorched-earth strategy was misguided and self-destructive.
Mr. Ryan, according to staff members, agreed that members of the Freedom Caucus were not negotiating in good faith, but he said that punishing them would also harm members who were simply trying to protect themselves from potential conservative primary challenges next year.
The speaker sealed the deal by telling Mr. Trump a public vote would turn a bad defeat into a spectacular loss that could alienate conservatives whom he would need for upcoming votes to raise the debt ceiling, to pass a budget and to enact an ambitious rewrite of the tax code. Retribution could also jeopardize the $1 trillion infrastructure package championed by Mr. Bannon.
Mr. Trump, aides said, was still annoyed, but agreed.
“You can’t pretend and say this is a win for us,” said Representative Mark Walker, Republican of North Carolina, who conceded it was a “good moment” for Democrats.
“Probably that champagne that wasn’t popped back in November may be utilized this evening,” he said.
At 3:30 p.m., Mr. Ryan called Republicans into a closed-door meeting to deliver the news that the bill would be pulled, with no plans to try again. The meeting lasted five minutes. One of the architects of the House bill, Representative Greg Walden, Republican of Oregon and the chairman of the Energy and Commerce Committee, put it bluntly: “This bill’s done.”
“We are going to focus on other issues at this point,” he said.
The Republican bill would have replaced the Affordable Care Act, known informally as Obamacare, which mandated that almost everyone have health insurance, with a system of age-based tax credits to purchase health insurance plans.
But it never won over conservatives who wanted a far more thorough eradication of the Affordable Care Act. Nor did it have the backing of more moderate Republicans who were anxiously aware of the Congressional Budget Office’s assessment that the bill would leave 24 million more Americans without insurance.
With the House’s most hard-line conservatives holding fast against it, the bill’s support collapsed Friday after more rank-and-file Republicans came out in opposition, including Representatives Rodney Frelinghuysen of New Jersey, the soft-spoken chairman of the House Appropriations Committee, and Barbara Comstock of Virginia, whose suburban Washington district went handily for the Democrat presidential nominee, Hillary Clinton, in November.
“Seven years after enactment of Obamacare, I wanted to support legislation that made positive changes to rescue health care in America,” Mr. Frelinghuysen wrote in a statement. “Unfortunately, the legislation before the House today is currently unacceptable as it would place significant new costs and barriers to care on my constituents in New Jersey.”
In the end, Republican leaders doomed the bill by agreeing to eliminate federal standards for the minimum benefits that must be provided by certain health insurance policies.
“This provision is so cartoonishly malicious that I can picture someone twirling their mustache as they drafted it in their secret capitol lair last night,” said Representative Jim McGovern, Democrat of Massachusetts. “This back-room deal will kill the requirement for insurance companies to offer essential health benefits such as emergency services, maternity care, mental health care, substance addiction treatment, pediatric services, prescription drugs and many other basic essential services.”
Defeat of the bill could be a catalyst if it forces Republicans and Democrats to work together to improve the Affordable Care Act, which virtually every member of Congress believes needs repair. Democrats have been saying for weeks that they want to work with Republicans on such changes, but first, they said, Republicans had to abandon their drive to repeal the law.
President Trump, through his budget director, Mick Mulvaney, told House Republicans on Thursday night that he was giving them this one chance to repeal the Affordable Care Act. If they failed, Mr. Mulvaney told them, the president would live with his predecessor’s law.
Rejection of the repeal bill may also prompt Republicans to reconsider the political strategy they were planning to use for the next few years.
“We have to do some soul-searching internally to determine whether or not we are even capable of functioning as a governing body,” said Representative Kevin Cramer, Republican of North Dakota. “If ‘no’ is your goal, it’s the easiest goal in the world to reach.”
Representative Robert Pittenger, Republican of North Carolina, offered this advice to hard-line conservatives who helped sink the bill: “Follow the example of Ronald Reagan. He was a master, he built consensus. He would say, ‘I’ll take 80 percent and come back for the other 20 percent later.’”
Failure of the House effort leaves the Affordable Care Act in place, with all the features Republicans detest.
The Republican bill would have repealed tax penalties for people who go without health insurance, rolled back federal insurance standards, reduced subsidies for the purchase of private insurance and set new limits on spending for Medicaid, the federal-state program for more than 70 million low-income people. The bill would also have repealed taxes imposed by the Affordable Care Act on health insurance providers, manufacturers of prescription drugs and medical devices, and many high-income people.
The bill would also have cut off federal funds to Planned Parenthood for one year.
Mr. Ryan said the bill included “huge conservative wins.” But those provisions were ultimately not enough.