Health insurance company stocks gained as Washington lawmakers inched closer to a bipartisan deal to shore up the Affordable Care Act.

Senators Lamar Alexander (R-TN) and Patty Murray (D-WA) have reached an agreement on a bipartisan fix to fund a key insurance subsidy program and provide states flexibility around parts of Obamacare. The maneuver could at least temporarily remedy a damaging blow President Donald Trump dealt to healthcare markets last week.

Alexander and Murray's plan would include two years of funding for Obamacare's cost-sharing reduction payments that make health insurance more affordable for low-income individuals and families. It would also open the door for less comprehensive plans with a lower premium and allow states to use existing Obamacare waivers to approve insurance plans with comparable affordability as ACA plans, according to multiple media reports.

Healthcare stocks, already higher in the wake of earnings reports from UnitedHealth Group Inc. (UNH - Get Report) and Johnson & Johnson (JNJ - Get Report) , inched higher in the wake of the news.

Shares of UnitedHealth were up 5.58% at market close on Wednesday. Shares of Anthem Inc.  (ANTM - Get Report) climbed 2.50%, shares of Cigna Corporation  (CI - Get Report) rallied 1.19%, shares of Aetna Inc.  (AET rallied 2.95% and shares of Humana Inc.  (HUM - Get Report) gained 1.37%.

Healthcare stocks fell last week when President Trump made a surprise announcement that he would end CSR funding, which are used to lower deductibles, co-payments, co-insurance and out-of-pocket maximums for those with incomes below 250% of the federal poverty level. The payments, made around the 20th of each month, are expected to total $7 billion in 2017.

Ending the payments could toss both individual and Obamacare markets into chaos, experts warned, and expand the deficit.

Former White House chief strategist Steve Bannon speaking at a conservative event in Washington on Saturday acknowledged as much, saying the president was going to "blow that thing up," referring to the Obamacare markets, in stopping CSR payments.

President Trump said the ACA is "finished" in a meeting with his Cabinet on Monday. "Obamacare is finished. It's dead. It's gone. You shouldn't even mention it. It's gone. There's no such thing as Obamacare anymore," he said.

Trump on Tuesday seemed to open the door to accepting Alexander and Murray's deal, calling it a "good short term solution." Of course, just because the pair have reached a deal does not mean anything will make it to legislation or the president's desk.

"The overall impact for insurers, it all depends on the amount of participation the insurer has in the healthcare exchanges," said Jeffrey Loo, analyst at CFRA Research, in an interview with TheStreet on Tuesday.

Anthem is the insurer most exposed to CSR risk, he said, noting that his firm downgraded the stock last week in the wake of Trump's announcement. Aetna has already pulled out of Obamacare markets for 2018, and Humana and UnitedHealth have pulled out of most.

"Potentially, some investors believe that with bipartisan support, the CSRs may continue, and keep in mind that Trump also did say it's up to Congress to continue funding or not," he said regarding the Alexandar-Murray deal. "Ultimately, it is Congress that controls the purse strings."

More of What's Trending on TheStreet: