Boeing reported a $4.16 billion loss for the fourth quarter as the financial fallout of production flaws in one of its best-selling planes, the 787 Dreamliner, grew much worse.

The aircraft maker took a charge of $3.5 billion to cover additional delays in delivering copies of its 787 jetliner and compensation for airlines that are still waiting to get their planes.

The company said manufacturing problems with the 787 will add $2 billion in unusual production costs, double an earlier projection.

Boeing is coming off a year in which aircraft sales rebounded after a slump caused by the grounding of its 737 Max airliner and a pandemic that crippled air travel. The Chicago-based company still finished far behind European rival Airbus in delivering new planes last year, partly because of the 787.

The two-aisle 787 was grounded for more than three months in 2013 by overheating lithium-ion batteries. After design changes, the plane became a hit with both airlines, which appreciated its fuel economy on long flights, and travelers, who liked the bigger windows and more comfortable cabin.

Boeing halted deliveries, however, in late 2020 because of production flaws, including gaps where panels of the carbon-composite fuselage are joined. Shortly after resuming deliveries, Boeing stopped them again in May 2021 as other problems emerged, including faulty titanium parts from a supplier, and the company has been unable so far to win Federal Aviation Administration approval for its fixes.

"The rework process is going well — it's long, it's disciplined, but it's going well," CEO David Calhoun told CNBC. "Our mechanics are learning a ton in the process."

Boeing's failure to resume deliveries is causing headaches for airline customers. Without the 787s that it expected to receive by now, American Airlines has dropped some international flights planned for next summer. American officials say Boeing has agreed to pay penalties for missing deadlines, and they say there could be negotiations over additional compensation if delays drag out much longer.

The 787 saga is unfolding just as Boeing tries to move past the grim early record of the 737 Max, which was grounded worldwide for nearly two years after two crashes that killed 346 people in all. Following a redesign that won FAA approval, Boeing delivered 245 Max jets last year, bringing in much-needed cash.

Separately, Boeing took a $402 million write-off for a refueling tanker that it makes for the U.S. Air Force. That charge pushed Boeing's usually reliable defense and space business to a loss.

Boeing's fourth-quarter loss compared with a loss of $8.44 billion during the same period a year earlier, when airlines had little appetite for new planes.

Excluding one-time charges, Boeing would have lost $7.69 per share — far worse than Wall Street expectations for a loss of 36 cents per share, according to a FactSet survey.

Revenue was $14.16 billion, down 3% from a year ago, also short of analysts' forecast of $16.54 billion.

CEO Calhoun called 2021 a rebuilding year, and said in a note to staff that Boeing is "well positioned to accelerate our progress in 2022 and beyond." He said the airline industry's recovery from the pandemic has spurred demand for new planes, and he expressed optimism about the long-term prospects for the 787.

Boeing shares fell more than 2% Wednesday.

David Koenig reports for the Associated Press.

Copyright 2022 AP. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.