WASHINGTON (AP) -- A bipartisan Senate deal to curb the growth of health insurance premiums is reeling after President Donald Trump reversed course and opposed the agreement and top congressional Republicans and conservatives gave it a frosty reception.

Sens. Lamar Alexander, R-Tenn., and Patty Murray, D-Wash., announced their accord Tuesday after weeks of negotiations and five days after Trump said he was halting federal subsidies to insurers. Under the lawmakers' agreement, the payments would continue for two years while states were given more leeway to let insurers sidestep some coverage requirements imposed by President Barack Obama's health care law.

In remarks Tuesday in the Rose Garden, Trump called the deal "a very good solution" that would calm insurance markets, giving him time to pursue his goal of scrapping Obama's 2010 Affordable Care Act, the target of Republican derision since it was signed into law.

Although top Democrats and some Republicans praised the Alexander-Murray compromise agreement, Trump backed off after a day of criticism from many in the GOP.

In an evening speech at the conservative Heritage Foundation, he said that "while I commend" the work by the two senators, "I continue to believe Congress must find a solution to the Obamacare mess instead of providing bailouts to insurance companies."

A White House official said Trump's statement was aimed at conveying opposition to the Alexander-Murray plan. The official spoke on condition of anonymity to discuss internal deliberations.

The subsidies -- called cost-sharing reductions -- go to insurers for reducing out-of-pocket costs for lower-income people. Since Obama's law requires insurers to make those cost reductions, insurers and others have warned that halting the subsidies would force premiums higher and prompt some carriers to abandon unprofitable markets.

"This agreement avoids chaos," Alexander said when he announced the deal. "I don't know a Republican or Democrat who benefits from chaos."

Alexander said the president had encouraged his efforts in two phone calls in recent days. But Trump has also repeatedly called the subsidies bailouts of insurers, who he's pointedly said have contributed little to his campaigns.

Just minutes before Alexander announced the deal, White House legislative director Marc Short told reporters that "a starting point" in exchange for restoring the cost-sharing payments "is eliminating the individual mandate and employer mandate." Those are the central pillars of "Obamacare," and Democrats solidly oppose eliminating them.

Senate Majority Leader Mitch McConnell was noncommittal about the agreement, telling reporters, "We haven't had a chance to think about the way forward yet." Aides to House Speaker Paul Ryan, R-Wis., did not provide a statement from him.

Both McConnell and Ryan have been eager to turn national attention away from the GOP push to scuttle Obama's law, which crashed in the Senate twice, and toward an effort to cut taxes.

Reaction from other Republicans toward the Senate agreement was mixed. For many conservatives it's practically unthinkable to sign off on federal payments that would arguably prop up a law they've been vowing for seven years to destroy.

Rep. Mark Walker of North Carolina, chairman of the conservative Republican Study Committee in the House, quickly denounced the deal over Twitter: "The GOP should focus on repealing & replacing Obamacare, not trying to save it. This bailout is unacceptable."

Freedom Caucus Chairman Rep. Mark Meadows, who's been at work on a proposal of his own, was slightly more positive, calling the Alexander-Murray bill "a good start" but saying much more work needed to be done.

Alexander said he and allies including Sen. Mike Rounds, R-S.D., would spend the next several days trying to build up support with the goal of formally introducing legislation later this week. If the legislation does pass, it would almost certainly be as part of a larger package including must-pass spending or disaster relief bills and that might not be until the end of the year.

Murray lauded the effort, saying, "When Republicans and Democrats take the time ... we can truly get things done" for the American people.

The Alexander-Murray deal includes provisions allowing states faster and easier access to waivers that would allow them to shape their own marketplace plans under "Obamacare."

It would provide for a new low-cost catastrophic coverage insurance option for all consumers. It would also restore $106 million for outreach and enrollment programs aimed at prodding people to buy policies -- efforts that Trump has slashed.

A federal judge ruled in a 2014 lawsuit brought by House Republicans that Congress never legally authorized spending money for the insurers' subsidies. Obama and Trump, initially, continued making the payments, though Trump declared last week he would pull the plug.

The payments, which cost around $7 billion this year, lower expenses like co-payments and deductibles for more than 6 million people. But discontinuing them would actually cost the government more money under Obamacare's complicated structure, because some people facing higher premiums would end up getting bigger tax subsidies to help pay for them.