Membership losses and the decision to write off more than a half-billion dollars in funding from the Affordable Care Act’s risk corridor program took a massive bite out of Humana’s fourth quarter profit.

The Louisville, Ky.-based insurer wrote off about $583 million in risk-corridor payments from the federal government, saying it’s unlikely the funds will be collected. Humana previously announced the write-off in December, so insurance analysts anticipated the loss and said results were in line with expectations.

The temporary federal risk corridor program was designed to discourage insurers from hiking premiums because of uncertainty in who would enroll in their exchange plans. It required more profitable insurers to pay funds into the program, while plans with higher medical claims received money. But Congress passed legislation requiring the program to be budget-neutral, so it can only pay out what it takes in. So far, the government is on the hook for roughly $8.3 billion from the program to offset losses on the exchanges from 2014 and 2015.

Republican lawmakers have labeled the risk-corridor payments “bailouts” and are committed to keeping the government from paying up. Several insurers have sued to recoup losses, and the Alliance of Community Health Plans filed a friend-of-the-court brief in one of those lawsuits late Tuesday urging the court to overturn a federal judge’s decision that the government was not contractually obligated to pay up.

But Humana decided to cut its losses. The impact from writing off those funds sent profit plummeting. Humana recorded a loss $401 million in the fourth quarter of 2016. To compare, the insurer’s fourth quarter profit in 2015 totaled $101 million. For the full year 2016, Humana’s profit was $614 million, down from $1.3 billion in 2015.

Humana’s President and CEO Bruce Broussard said in a statement that the yearly results were strong, especially given that the insurer has been operating with a major lawsuit against its planned merger with Aetna playing out in the background. A federal court in January sided with the Justice Department and blocked the pending merger, saying it would harm competition in Medicare Advantage and exchange plans.

Humana said it is reviewing the court’s ruling. Aetna and Humana could appeal, which would allow them another chance at closing the merger under the new federal administration led by President Donald Trump, who some observers expect will be softer on antitrust matters. Humana said it will update investors on the merger by no later than Feb. 16.

The loss in profit was also driven by membership losses and lower premiums from Humana’s individual commercial and group Medicare Advantage plans. This year, Humana significantly reduced the individual plans it sells on and off the ACA exchanges. It now sells on-exchange coverage in 11 states, down from 15 last year.

It also pulled the plug on essentially all of its off-exchange plans. When Humana announced its decision in July, it said it expected to collect anywhere from $750 million to $1 billion in premiums from its individual ACA plans in 2017. That’s down almost 80% from the $3.4 billion premiums projected for 2016.

Membership in individual plans fell by 244,000 during the year to 654,800 as of Dec. 31. It’s is set to decline even more: Humana said its membership as of January after the ACA’s open enrollment that ended Jan. 31 was about 204,000.

Humana also lost a large group Advantage account that went to a private exchange at the beginning of 2016, which the insurer previously disclosed.

Still, the insurer added members in its individual Advantage business. Membership in those plans was 2. 8 million as of Dec. 31, up 3% from the same time in 2015. Humana also said it added about 10,400 members during the Medicare Advantage annual open enrollment period.

It wasn’t enough to offset the dip in fourth quarter revenue, which totaled $12.9 billion in the fourth quarter, down 3.6% from the same period in 2015. For the full year, revenue was $54.8 billion, up slightly from $54.3 billion in 2015.

Humana’s medical-loss ratio, or the amount of collected premiums that is spent on medical care and quality improvement, was 89.2% in the fourth quarter, compared with 85.8% during the same period in 2015. That was largely due to lower premiums associated with the write-off of risk corridor payments and a charge from its closed long-term care business. For the year, Humana’s medical-loss ratio was 84.9%, up from 84.5% in 2015.