Two US congressional panels on Thursday approved Republican plans to replace Obamacare, after marathon debate on the controversial health legislation that is backed by President Donald Trump but opposed by some in his party.

After 18 marathon hours of debate the House Ways and Means Committee became the first panel to approve the that would repeal and replace Democrat Barack Obama's landmark health reforms.

But the House Energy and Commerce Committee—a separate panel that began reviewing the legislation at the same time Wednesday morning—took more than 27 continuous hours to "mark up" the bill, finally voting along strict party lines for its approval.

"Today, the House took a decisive step forward in fulfilling a promise to the American people that has been years in the making: repealing and replacing Obamacare with affordable, patient-centered reforms," Energy and Commerce chairman Greg Walden said.

Tempers frayed overnight during several testy exchanges, including one over military veteran coverage in the proposed legislation and another on its costs—still unknown because the Congressional Budget Office has yet to "score" the bill.

The legislation now heads to the House Budget Committee.

Republican leaders have forged ahead with their proposal despite mounting opposition from within the party, heaping pressure on Trump as he faces resistance to his top legislative priority.

"House health-care bill can't pass Senate w/o major changes," Senator Tom Cotton tweeted early Thursday, joining a host of other Senate Republicans opposed to the measure in its current form.

While Republicans hold comfortable control of the House, they hold a narrow 52-48 majority in the Senate.

"To my friends in House: pause, start over. Get it right, don't get it fast," Cotton added.

Republican leaders indicate they want to pass the bill by early April. But that timeline was put in question after House Speaker Paul Ryan said the bill will take three weeks to move through the House, before facing scrutiny in the Senate.

With its future in doubt, Ryan delivered a crisp presentation Thursday in a bid to salvage the plan, but also offered a direct warning to Republicans sitting on the fence.

"This is the closest we will ever get to repealing and replacing Obamacare," he said. "The time is here, the time is now."

The plan suffered a setback Wednesday when several major hospital and medical organizations including the American Medical Association, which represents more than 200,000 doctors, lined up in opposition.

Backers say the legislation would gut Obamacare's mandates to purchase health care, roll back its taxes and stabilize costs.

Republican opponents warn the plan is too similar to Obamacare, and could cost even more.

Democrats, expected to unanimously oppose the bill, say it would leave millions of Americans without coverage.