President Obama is scrambling to keep his signature health reform law intact.

A slew of insurers — including industry giants Aetna and United Health — have elected to leave most of the exchanges they initially participated in after sustaining heavy losses over the last two years. President Obama has responded with a letter formally thanking those who haven't fled — and is begging them to help enroll more people.

But it's unlikely that insurers will consent to losing billions just because the president asked them nicely. They're looking for federal cash. And the president appears willing to give it to them. There's only one problem — the administration's scheme for transferring taxpayer dollars to insurers may be against the law.

Because Obamacare guaranteed health coverage to all people regardless of their health status or history and limited the prices insurers could charge, the law's architects knew that higher-risk, costlier enrollees would flood the exchange markets.

To offset the costs of insuring these folks, they counted on enrolling an even greater number of young, healthy people who would pay premiums into the risk pool but not need much care.

To smooth things over as the exchanges got going, Obamacare also included several programs to compensate insurers for early losses.

One was the risk corridor program. The feds planned to collect money from plans that had lower-than-expected medical claims and distribute it to plans with higher-than-expected costs.

That might have worked if insurers actually took in enough to cover their enrollees' health costs. Most did not.

A lot of healthy people sat out and paid the fine for going without insurance. Exchange coverage was too expensive for them. And that meant that the exchange pool was sicker and costlier than expected.

Indeed, insurers requested $2.9 billion to cover 2014's higher-than-expected losses. But profitable insurers were only able to contribute $360 million to the risk-corridor program. Congress dictated that the program had to be budget-neutral — that is, the money paid out to insurers could not exceed the money collected. So insurers received just 12.6 percent of their total claims.

That didn't sit well with several insurers, who have sued the Obama administration for failing to deliver on 2014 claims.

Those who lost money in 2015 may end up on the short end this time around. Federal officials just announced that all the funds they collected in 2015 will be used to cover 2014 losses.

The administration is also considering some alternative legal jiu-jitsu to funnel money to insurers. In a recent statement, federal officials indicated that they will try to pay insurers via individual court settlements. Since the money for such settlements comes out of a separate fund, it avoids the program's requirement that the payments be budget-neutral.

The effect on taxpayers is the same. The administratio n is bailing out insurance companies, regardless of what line in the federal budget the money comes from.

Team Obama's extralegal bailouts don't stop there. The administ ration is also trying to pervert Obamacare's risk-adjustment program — which redistributes funds from plans with healthier enrollees to those with sicker enrollees — to keep insurers in the exchanges.

Among other tweaks, officials want to spread the cost of claims in excess of $2 million across all insurers nationwide.

But as University of Houston professor Seth Chandler has pointed out, the proposal violates Obamacare's text. The law states that officials must consider claims on a state-by-state basis when determining which insurers must pay and which are eligible for payments.

The new proposal, by contrast, attempts to create a national reinsurance market. That could force insurers in one state, presumably one with lower medical costs, to send money to insurers in another, probably higher-cost state. And that's not authorized by the law.

Obamacare is in a death spiral. Insurers are fleeing the exchanges because they're losing money — and the federal government isn't paying them enough to stick around. Consumers are staying away because coverage costs too much.

Even so, the administration is not justified in ignoring Obamacare's text as part of an effort to save it. Instead of writing letters to insurers, President Obama should adhere to the letter of the law.

Sally C. Pipes is President, CEO, and Thomas W. Smith Fellow in Health Care Policy at the Pacific Research Institute. Her latest book is The Way Out of Obamacare (Encounter, 2016).Thinking of submitting an op-ed to the Washington Examiner? Be sure to read our guidelines on submissions.