Boeing on Wednesday 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.

A top United Airlines official said this month that the carrier doesn’t expect to get new 787s until after this summer, and it will reduce flying as a result. The planes were supposed to be delivered in the first half of last year.

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.

Jeff Windau, an analyst for Edward Jones, said the size of Boeing’s write-downs was a surprise, and the company must do something to boost business with China, which only recently cleared the 737 Max to resume flying. But Boeing generated positive cash flow for the first time since early 2019, and sales are up.

“They have done a nice job rebounding from where they were on orders, and I think it is setting them up nicely from a long-term perspective,” he said.

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 almost 5% in afternoon trading Wednesday.

___

David Koenig can be reached at www.twitter.com/airlinewriter