WASHINGTON (Reuters) - U.S. President Donald Trump warned House Republican lawmakers that he will leave Obamacare in place and move on to tax reform if they do not get behind new healthcare legislation and support it in a vote on Friday.

It was not clear late on Thursday evening that Trump and the Republican leaders who crafted the bill had enough support to pass it, meaning they now risk defeat in their first attempt at major legislation and may fail to deliver on a key campaign pledge.

“We have been promising the American people that we will repeal and replace this broken law because it’s collapsing and it’s failing families, and tomorrow we’re proceeding,” House Speaker Paul Ryan told reporters after an evening all-hands meeting. He ignored reporters who asked if he had secured the votes to pass the bill.

Ryan and leaders in the House of Representatives were forced to postpone a vote on their healthcare bill, formally called the American Health Care Act, earlier on Thursday, dealing Trump an embarrassing setback.

The vote had been symbolically planned for the anniversary of former Democratic President Barack Obama signing his namesake healthcare law, the Affordable Care Act, in 2010. It was supposed to have been Trump’s first legislative victory.

Trump and his fellow Republicans had pledged to replace Obamacare, which they view as too intrusive and too expensive.

But, after a week of calling Republican lawmakers and bringing them into the Oval Office for meetings, Trump failed to close the deal with two different factions within his party on time for the planned Thursday vote.

Conservatives felt the bill did not go far enough to repeal Obamacare and moderates felt the plan could hurt their constituents. House Republican leaders had signaled they were ready to work through the weekend to figure out a way to reconcile their differences.

As the healthcare drama unfolded on Capitol Hill, Trump played it cool, taking a break from negotiations to hang out with some truckers, climbing into the cab of a long-haul transport truck parked on the back driveway of the White House, and blowing the horn a few times.

He told reporters the vote would be close but he remained optimistic. “I think we’re doing well. We’ll find out in about three hours,” he said, just as reports began to surface that the vote had been postponed.

By evening, Trump sent his top lieutenants to a dramatic meeting on Capitol Hill on Thursday night with an ultimatum: he was done talking. According to Representative Chris Collins of New York, a top Trump ally, White House budget director Mick Mulvaney told House Republicans that Trump wanted a vote.

“The president has said he wants a vote tomorrow, up or down,” Collins said.

“If for any reason it is down, we are just going to move forward with additional parts of his agenda” such as tax reform, Collins told reporters after leaving the meeting.

However, the vote has been seen by financial markets as a crucial test of Trump’s ability to work with Congress to deliver on his other priorities, such as tax cuts and infrastructure spending.

Even if their replacement plan does eventually get approval from the House, the legislation faces a potentially tough fight in the Republican-controlled Senate.

The House and Senate had hoped to deliver a new healthcare bill to Trump by April 8, when Congress is scheduled to begin a two-week spring break.

Slideshow ( 17 images )

GETTING TO YES?

The Republicans have a majority in the House but, because of united Democratic opposition, can afford to lose only 21 Republican votes. By Thursday morning, NBC News said that 30 Republicans had planned to vote “no” or were leaning that way.

North Carolina Congressman Mark Meadows, the chairman of the pivotal conservative bloc known as the Freedom Caucus, said he and others were struggling to support the plan.

“I am desperately trying to get to ‘yes’ and I think the president knows that. I told him that personally,” Meadows said. However, after Thursday night’s meeting, he was still a ‘no’.

Obamacare aimed to boost the number of Americans with health insurance through mandates on individuals and employers, and income-based subsidies. Some 20 million Americans gained insurance coverage through the law.

Slideshow ( 17 images )

The House replacement plan would rescind the taxes created by Obamacare, repeal a penalty against people who do not buy coverage, slash funding for the Medicaid program for the poor and disabled, and modify tax subsidies that help individuals buy plans.

House leaders agreed to four pages of last-minute amendments to the bill, including allowing states to choose which “essential benefits” are required in healthcare insurance plans, and keeping a 0.9 percent surcharge on Medicare for high-income Americans for six years. It was unclear whether that was enough.

Representative Trent Franks, a Freedom Caucus member who had been “undeclared” on his position on the bill, said he liked the changes. “It’s going in the right direction,” Franks said outside the House.

The amendments will give states more money for maternal health and mental health, said Representative Jeff Fortenberry, a Nebraska moderate who still has not said how he will vote.

MARKETS WATCHING CLOSELY

Uncertainty over the healthcare bill rattled financial markets this week. The delay in the house vote is likely to extend the ups and downs in the stocks of some hospital groups and health insurers.

U.S. stock markets rose steadily in recent months on optimism over a pro-business Trump agenda but fell back sharply on Tuesday as investors worried that failure to push through the healthcare bill could postpone other business-friendly Trump priorities.

“Delay on healthcare equates to delay on tax cuts. That is why the market turned red when the news flow suggested they didn’t have a deal,” said David Kotok, chairman and chief investment officer at Cumberland Advisors, a money management firm.

Others said it was too soon to panic.

“If this thing gets materially delayed or if we get a ‘no’ vote, we’re going to see a horrific market reaction. But if they vote in the morning and it passes, we’ll have a hell of a rally,” said Jake Dollarhide, chief executive officer of Longbow Asset Management in Tulsa, Oklahoma.

Graphic on Obamacare and Republican healthcare bill (tmsnrt.rs/2n0ZMKf)

Graphic on shifting positions in the U.S. Senate on Republican healthcare bill (tmsnrt.rs/2mUE4Xf)

Graphic on poll on Americans' views of the Republican healthcare bill ( tmsnrt.rs/2n7f3e4)