WASHINGTON (Reuters) - The Republican plan backed by President Donald Trump to overhaul the U.S. healthcare system cleared its first hurdles in Congress on Thursday, but its chances for passage looked uncertain and top Republicans scrambled to bring disgruntled conservatives aboard.

In the face of opposition by Democrats, healthcare providers and many conservatives, two House of Representatives committees approved the legislation that would undo much of the 2010 Affordable Care Act, popularly known as Obamacare, moving it closer to a vote before the full House.

The Energy and Commerce Committee voted 31-23 along party lines, with Democrats unified against it, to back the plan after marathon proceedings lasting 27 straight hours. Hours earlier, the tax-writing Ways and Means Committee similarly voted 23-16 before dawn to approve it after working 17 straight hours.

House Speaker Paul Ryan sought to bolster support among conservatives in his own party, Senate Majority Leader Mitch McConnell said fellow Republicans must get in a “governing mode” while Trump denied the bill was in trouble.

“Despite what you hear in the press, healthcare is coming along great. We are talking to many groups and it will end in a beautiful picture!” the Republican president said on Twitter.

The bill would replace Obamacare’s income-based subsidies with a system of fixed tax credits to help people buy private insurance on the open market, while ditching the Obamacare expansion of the Medicaid insurance program for the poor. It would also end penalties for not having insurance, though insurers would be given permission to impose a 30 percent surcharge on customers who let their coverage lapse for more than two months and then seek to renew.

Hospital stocks, which has fallen after the plan was unveiled on Monday, ended broadly higher on Thursday, with Tenet Healthcare up 3.4 percent. Shares of health insurers were mixed, with most large insurers modestly higher and Medicaid-focused insurers ending negative, including Molina Healthcare’s 3.3 percent drop.

While Republicans have been itching for seven years to dismantle Democratic former President Barack Obama’s signature domestic policy achievement, the party has failed to coalesce behind the plan put forth by House Republican leaders.

Republicans control the White House and both houses of Congress for the first time in a decade, but passage of the legislation was not a foregone conclusion.

Conservative lawmakers and lobbying groups have lambasted it as too similar to Obamacare. They have sharply criticized its proposed tax credits as an unacceptable new government entitlement program and have called for a quicker end to the Obamacare Medicaid expansion.

The measure is the first major legislative test for Trump and his fellow Republicans amid questions about whether they can govern effectively after years spent as an opposition party under Obama.

Ryan, with his shirt sleeves rolled up and using a video screen with facts and figures, held what he called a “townhall-style” presentation for reporters on the proposal. But his intended audience appeared to be fellow Republicans, and he said his party must “actually make good on our word.”

“The time is now,” said Ryan, who long has been the target of criticism of some conservatives. “This is the closest we will ever get to repealing and replacing Obamacare,” Ryan added.

Slideshow ( 8 images )

McConnell had a similar message, saying, “We need to get into a governing mode and start thinking about actually achieving something rather than just kind of sparring.”

Democrats denounced the bill as a gift to the rich that would force millions of people off of insurance rolls. Republicans said it was needed to roll back the government’s “nanny state” role in the more-than-$3 trillion U.S. healthcare system.

“Trumpcare is a loser for just about all of America, unless you’re in the top 1 percent,” Senate Democratic Leader Chuck Schumer said.

Slideshow ( 8 images )

The House Budget Committee next Wednesday is due to merge the provisions approved by the two committees into one bill to be voted on by the full House before it goes to the Senate. Republican leaders are eyeing April for congressional passage of the bill.

‘ARBITRARY LEGISLATIVE CALENDAR’

In a series of tweets early on Thursday, conservative Republican Senator Tom Cotton urged his House colleagues to pull back, saying their measure could not pass the Senate without major changes. “What matters in long run is better, more affordable health care for Americans, NOT House leaders’ arbitrary legislative calendar,” Cotton wrote.

But White House spokesman Sean Spicer expressed confidence in the legislation’s prospects. “We’re not jamming this down people’s throat,” Spicer said. “This bill will land on the president’s desk. He will sign it. We will repeal Obamacare.”

The Brookings Institution think tank forecast that the nonpartisan Congressional Budget Office, expected early next week to release its closely watched assessment of the bill’s cost and coverage implications, would conclude that at least 15 million people would lose health insurance.

Credit rating agency Standard & Poor’s earlier estimated 6-10 million people could lose health insurance coverage.

Before the Energy and Commerce Committee vote, conservatives at the request of the panel’s chairman withdrew an amendment sponsored by Republican Joe Barton that would move up by two years, to next Jan. 1, the end of the Medicaid expansion. Barton said he planned to try to offer the amendment on the House floor.

Committee Chairman Greg Walden hailed the unanimity of Republicans on the committee in approving the bill.

Obamacare enabled 20 million previously uninsured people to obtain coverage. About half came from the Medicaid expansion.

The bill’s proposed changes in Medicaid funding could hurt smaller, less diverse health insurers, Fitch Ratings said, and the unintended, unforeseen consequences of a bill this size are likely to create uncertainty for all health insurers.

With doctors, hospitals, seniors, health plans, Democrats, some governors and conservative Republicans against the bill, it may not make it out of the House, Mario Molina, chief executive of managed care company Molina Healthcare, said in an interview.

“If it does, I think the Senate is going to slow things down and really take a good look,” Molina said. “We are going to have to hope that the Senate is more moderate.”