The Boeing Co on Wednesday swung to its first annual loss since 1997 on mounting 737 MAX costs and indicated it would again cut production of its bigger 787 Dreamliner aircraft, currently its main source of cash.

Costs related to the global grounding of Boeing's once fast-selling 737 MAX reached $14.6bn in 2019 and the planemaker warned of another $4bn in charges in 2020 due to the expense of freezing and slowly restarting the jets' production.

More:

The MAX grounding in March after two crashes that killed 346 people forced the planemaker to freeze production of the aircraft this month and led to the removal of former Chief Executive Officer Dennis Muilenburg.

"We recognize we have a lot of work to do," Boeing President and CEO David Calhoun said in a statement. Boeing had previously estimated an $8bn price tag for the MAX fallout.

Boeing shares rose 3 percent in premarket trading, as some analysts had expected an even larger charge for 737 MAX costs. The stock has lost about a quarter of its value since early March 2019.

The Chicago-based planemaker has been updating the 737 MAX flight control system and software to address issues believed to have played a role in both crashes.

The United States Federal Aviation Administration has suggested that it could approve the MAX to fly again before mid-year, longer than Boeing had initially expected.

Calhoun told business news network CNBC on Wednesday he believes the company can meet the certification timeline.

Boeing's core operating loss was $2.53bn, or $2.33 per share, compared with a profit of $3.87bn, or $5.48 per share, a year earlier.

Analysts on average expected Boeing to post earnings per share of $1.47 in the quarter, though several had predicted a loss amid a wide range of forecasts due to uncertainties over the cost of the 737 MAX crisis.

The company also booked more charges on its military tanker and space programmes.

Adding to Boeing's pain, demand for its bigger and more profitable jet - the 787 Dreamliner - has waned in the face of the US-China trade war, prompting the company to cut production, hurting cash flow at a time when its debt is mounting.

Boeing, which is producing the 787 Dreamliner at a rate of 14 aircraft per month, said in October it expects to lower the production in late 2020 to 12 per month, amid a drought in orders from China.

The company now expects to further lower 787 Dreamliner production to 10 per month in early 2021.

Boeing reported negative free cash flow (the cash left over after the company pays for operating costs, equipment and assets) of $2.67bn for the fourth quarter ended December 31, compared with a positive free cash flow of $2.45bn a year earlier.

The MAX charges include $8.3bn to compensate airline customers that are cancelling flights and scaling back growth plans in a hit to profits while their MAX jets remain grounded.

"The largest positive here is that the charges booked in the quarter came in well below our expectations," Credit Suisse analyst Robert Spingarn wrote in a note.