Drugmaker Pfizer Inc. swung to a fourth-quarter financial loss, instead of a modest profit, as a result of a just-announced charge to settle a long-running federal case over reimbursements for its former blockbuster heartburn pill.

Pfizer, which is planning a mega-acquisition of Irish drugmaker Allergan meant to reduce Pfizer's corporate bill, said Tuesday that it has a tentative agreement to pay the federal government $784.6 million. That would resolve litigation over the calculation of rebates Wyeth paid the government for Medicaid purchases of its severe heartburn treatment, Protonix. The agreement must be approved by U.S. District Judge Douglas P. Woodlock in Massachusetts, Pfizer said.

Pfizer, the largest U.S.-based drugmaker, said it is charging the payment to its fourth-quarter results, which it restated on Tuesday. That left the New York-based company with a loss of $172 million, or 3 cents per share, in the last quarter, compared with a net profit of $613 million, or 10 cents per share, initially reported on Feb. 2.

For all of 2015, Pfizer is now reporting net income of $6.96 billion, or $1.11 per share, down from the $7.75 billion, or $1.24 per share, reported two weeks ago. Pfizer said its adjust results for the quarter will not change.

Protonix heals acid reflux damage to the esophagus. Cheaper generic versions of the drug, known as pantoprazole, came on the market about five years ago and around a dozen are available.

The settlement would resolve cases pending in federal court that centered on Wyeth's practices related to rebates on Protonix sales between 2001 and 2006, when its patent, and market exclusivity, were still in force. Pfizer bought Wyeth in the fall of 2009.

Wyeth is not admitting any liability, which is typical in the many settlements drugmakers reach with federal prosecutors for allegedly overcharging government health programs and other misconduct.

A few years ago, Pfizer paid $55 million to resolve allegations that Wyeth promoted Protonix for uses not approved by the Food and Drug Administration.

Pfizer expects to wrap up its $160 billion purchase of Allergan in the second half of this year, then move Pfizer's official headquarters for tax purposes from New York to Allergan's base in Dublin. The strategy, called a tax inversion, would sharply decrease Pfizer's tax bill from its current U.S. tax rates, though the drugmaker's operational headquarters would remain in New York.

In early-afternoon trading, Pfizer shares rose 32 cents, or 1.1 percent, to $29.68. The broader markets were up by about the same percentage.