Boeing has posted its largest-ever quarterly loss as it warned that it might have to halt production of its 737 Max aircraft if grounding continues much longer.

The company reported a loss of $3.4 billion in its second quarter 2019 financial results – due to the troubled plane and the charges surrounding it.

Revenue for the firm was down 35% from the previous year to $15.8 billion, from $24.8 million experienced in 2018, with deliveries coming in at 90 commercial aircraft in the second quarter, down from 194 aircraft in the same period last year.

Boeing’s overall operating cash flow slumped to a negative $0.6 billion in the quarter, from $4.7 billion in the previous year. However, Boeing was quick to stress that this “primarily reflecting lower 737 deliveries and production rate as well as timing of receipts and expenditures”.

If Boeing continues to struggle with regulators and other issues, the planemaker said it would consider reducing or shutting down production of the 737 Max entirely.

However, Boeing boss Dennis Muilenburg remains confident the plane will be back in the air by October.

In a conference call, Muilenburg said: “As our efforts to support the 737 Max’s safe return to service continue, we will continue to assess our production plans.

“Should our estimate of the anticipated return to service change, we might need to consider possible further rate reductions or other options, including a temporary shutdown of the Max production.”

Last week, the planemaker warned that it would take a loss resulting in the after-tax charge in its second-quarter results.

Boeing’s entire fleet of flagship 737 Max planes was grounded in March after issues with the model were linked to an Ethiopian Airlines flight crash that killed 157 people.

Five months earlier, 189 people were killed when a Boeing 737 Max operated by Lion Air crashed.