Updated

Alaska Republicans are joining with Democrats in taking drastic action to save the state’s ObamaCare insurance system from spiraling into crisis, as all but one insurer flee the state and health care costs soar.

While state Republicans remain largely opposed to the health care law, the GOP-dominated legislature passed a bill earlier this month that aims to prevent massive premium hikes and keep the ObamaCare system afloat for the thousands of residents already in the system. The measure was introduced by Gov. Bill Walker.

“Over the past two years, my team and I have received hundreds of calls and emails from Alaskans who say health care costs are increasingly unaffordable,” Walker, once a Republican and now an independent, said in a statement. “This legislation will provide relief from substantial premium increases for 23,000 Alaskans who are insured through the private marketplace as we continue work to bring more insurers into Alaska.”

Walker’s office said that three insurers have left Alaska since 2015, and that the one remaining insurer, Premera Blue Cross Blue Shield, would have to pull out or pass costs on to customers if the state does not offer relief.

The legislation establishes a state health insurance fund to stabilize rates for all Alaskans by subsidizing costs for high-cost customers, according to Politico, which earlier reported on the move. The costs would be covered by existing funds from a tax on insurance premiums that all insurance companies pay.

“Had this problem not been addressed this year, it would have cost the state more than $200 million next year,” Lori Wing-Heier, Division of Insurance director, said in a statement.

The bill passed both chambers with almost unanimous bipartisan support, and will soon go to the governor’s desk for his signature.

State Senate Democratic Leader Berta Gardner told FoxNews.com the bill was necessary in part due to Alaska’s unique situation, which makes health care particularly expensive.

“Because Alaska is a very high cost area and we have a small scattered population, insurance companies are not eager to do business here,” Gardner said. “Costs are high and there are relatively few people. For instance there is no rheumatologist in the entire state.”

Gardner rejected the claim that the crisis has been caused by ObamaCare: “It’s been a long standing problem, well before the Affordable Care Act.”

State Rep. Lora Reinbold, who was the sole House Republican to vote against the bill, told Politico she objected to the legislation as “failed federal policies continue to take tremendous toll on state budgets.”

However, Republican U.S. senators offered support for the legislation and laid the blame for the crisis at the feet of ObamaCare.

Sen. Dan Sullivan told FoxNews.com in a statement that Alaska is facing a “difficult predicament” imposed on it by a law that has caused Alaskans to lose their doctors and has shrunk the market.

“Now the state is facing the difficult predicament of having to spend even more taxpayer dollars to prop up this failing system. It’s outrageous,” Sullivan said. “This is exactly why we voted to repeal ObamaCare—which was vetoed by the president--and why we will continue to work to undo the damage that’s been done under this law.”

Meanwhile Sen. Lisa Murkowski called the legislation necessary to prevent Alaskans losing coverage.

“Senator Murkowski commends the Alaska State Legislature for working to address the problems in Alaska created by the Affordable Care Act and doing what is necessary to avoid thousands of Alaskans losing their coverage,” a spokeswoman for Murkowski told FoxNews.com.

FoxNews.com's Adam Shaw contributed to this report.