WASHINGTON — Democratic and Republican leaders in the Senate announced they have reached a bipartisan deal to shore up the Affordable Care Act health insurance markets for two years while Congress continues to grapple with GOP efforts to replace the law.

Sens. Lamar Alexander, R-Tenn., and Patty Murray, D-Wash., the leaders of the Senate health committee, said Tuesday they have struck a deal for a two-year extension of subsidies for insurance companies to cover low-income clients — subsidies that President Trump canceled last week.

Alexander told reporters the deal would also expand authority for states to experiment with alternative standards for insurance plans that deviate from federal requirements, but it would not do away with the requirement to cover people with pre-existing conditions. The deal would also not eliminate so-called essential health benefits — such as mental health and maternity care — that insurance plans must cover.

Republican efforts to repeal Obamacare ran aground in part because of concerns of both Democrats and Republicans that these provisions would be eliminated.

The agreement would involve a two-year extension of federal payments to insurers that Trump halted last week. Unless the money is quickly restored, insurers and others say that will result in higher premiums for people buying individual policies and in some carriers leaving unprofitable markets.

"This agreement avoids chaos," Alexander said. “Over the next two years, I think, Americans won’t have to worry about the price of health (insurance) and being able to buy insurance in the counties where they live."

Alexander and Murray have been working for weeks on health care legislation, separate from repeated and unsuccessful efforts by GOP leaders to dismantle former president Barack Obama’s Affordable Care Act.

Senate Majority Leader Mitch McConnell, R-Ky., said he does not yet have a timetable for bringing the bill to a vote on the Senate floor. "We haven’t had a chance to think about the way forward yet," he told reporters.

In brief comments at the White House, Trump spoke favorably about the effort.

“It is a short-term solution so we don’t have this very dangerous little period,” the president said.

Read more:

Trump seems supportive of bipartisan two-year deal for Affordable Care Act subsidies

Analysis: How Trump is unraveling Obamacare piece by piece

Murray and Alexander began talks on extending the payments months ago, when Trump was frequently threatening to stop the subsidies. Both had said they were close to a deal, but GOP leaders shut the effort down in September when the Senate revisited the Republican drive to repeal Obama’s law. The repeal effort failed, as did an earlier GOP attempt to dismantle the law in July.

Alexander said Trump has spoken to him twice in recent days to urge him to reach a deal with Murray.

“He says he doesn’t want people to be hurt in this interim,” said Alexander, a reference to Trump’s desire to revisit the effort to scrap Obama’s statute next year.

Murray said the deal is necessary because "the uncertainty and dysfunction can’t continue." While details of the deal are still being worked out, she said, "Chairman Alexander and I were able to find common ground on a number of steps to stabilize markets, and help protect families from premium spikes."

Senate Minority Leader Chuck Schumer said, "Two years of cost-sharing provides real stability to the system and we want to make sure that happens ... I think there’s a growing consensus that in the short term we need stability in the markets."

The New York Democrat said Trump’s move to eliminate ACA subsidies helped because Republicans were suddenly facing the consequences of millions not being able to afford health care and they didn’t want “the consequences of this on (their) doorstep and it pushed it closer to a deal with us.”

Trump repeated his gloomy assessment of a law that’s expanded health coverage to 20 million people and required insurers to cover specified services and limit costs, but has also seen premiums rise and limited competition in some regions.

“Obamacare is virtually dead. At best you could say it’s in its final legs. The premiums are going through the roof. The deductibles are so high that people don’t get to use it. Obamacare is a disgrace to our nation and we are solving the problem of Obamacare,” he told reporters in the Oval Office.

Under Obama’s 2010 overhaul, the government must pay insurers for reducing out-of-pocket expenses for lower-earning customers.

A federal judge has ruled that Congress hadn’t legally approved the payments, but Obama — and initially Trump — continued them anyway. Trump halted them last week, even though by law insurers must continue reducing costs for lower-income consumers.

Trump and some Republicans consider the payments to be bailouts to carriers. But Democrats and some Republicans say halting them will create chaos in insurance marketplaces.

The so-called cost-sharing reductions cost around $7 billion this year and lower expenses like co-payments and deductibles for more than 6 million people.

Contributing: Nicole Gaudiano, Ledyard King and The Associated Press