SEATTLE — Ahead of its official quarterly earnings release next week, Boeing on Thursday bit the bullet and announced a huge $4.9 billion after-tax accounting charge due to the financial impact of the 737 MAX grounding.

This big cut to earnings will produce Boeing’s first quarterly loss in ten years. Prior to the announcement, S&P Capital IQ had projected a second-quarter profit of $1.3 billion, which will now turn into a loss of around $3.6 billion, the largest loss in Boeing history.

The last time Boeing recorded a net loss was the third quarter of 2009, when it lost $1.6 billion after writing off three flight test 787 Dreamliners and taking a charge for delays on the 747-8.

The charge was recognized in expectation that penalties for late deliveries and other costs will continue over a number of years, even assuming that regulators clear the MAX to fly again in early fall.

In addition to that one-time charge, Boeing also increased its estimated costs to produce the 737 by $1.7 billion in the second quarter, primarily due to the reduced production rate.

That means that this amount will be added to the cost of manufacturing the 737, spread out over the assumed number of 737s remaining to be built, which for accounting purposes is just over 3,000 aircraft.

Boeing similarly added $1 billion to the 737 production costs last quarter because of the reduced production. The combined $2.7 billion addition to the costs will reduce the profit margin on each future 737 delivery and cut the cash flow per aircraft delivered by $900,000.

Boeing said that the charge to earnings will cut its quarterly revenue and pre-tax profits by $5.6 billion.

It added that although this charge is being taken now, the potential concessions to customers or penalties paid will be provided over a number of years. That means most of the impact on cash flow will occur in the future.

And some of that may not be in direct cash payments. For example, an airline could potentially choose to take a big discount on a future order or free maintenance support rather than upfront money.