A.P. Moller-Maersk A/S lost money unexpectedly during 2016 as the biggest company in Denmark wrote down energy asset values it holds and is planning to spin off.

Shares of Maersk dropped by as much as 7.1% as the conglomerate based in Copenhagen posted a net loss for 2016 of more than $1.94 billion. Wall Street was expecting a profit of more than $963 million.

With the loss just posted, Maersk now has just two annual losses since the end of WWII. It wrote down over $2.7 billion in its Maersk Supply Service and Maersk Drilling units.

In addition, Maersk announced that Michael Pram Rasmussen, the chairman, would step down from the board after leading it for 18 years. He is to be replaced by Siemens chairman Jim Hagemann Snabe.

Snabe, along with Soren Skou, who last year was promoted to CEO, will oversee plans at Maersk to separate its four energy units that include its petroleum producer in the North Sea, Maersk Oil as the company looks to place its main focus on transport operations.

One European credit analysts said that impairments are often seen as being a cleanup tactic for ongoing strategic initiatives.

Shares of Maersk were down 4% in early trading. The stock is down by 0.8% in 2017 and its price gives it a market value of more than 228 billion kroner or $32.5 billion.

Maersk’s last annual loss was in 2009, when trade was crippled by the global financial crisis.

Meanwhile, the container line of the company looks to have a better year in 2017. The underlying result for Maersk Line will be over $1 billion above the loss of $384 million booked during 2016, said company officials.

The guidance looks slightly soft for 2017 for Maersk Line, said an analysts in London. The company projects $600 million in profit for 2017, while analysts are saying $1 billion.

Maersk is expecting the worldwide container market to expand by between 2% and 4% during 2017. That forecasts comes amidst a wave of consolidation, with the shipping industry globally struggling, as it has struggled for the past decade trying to adapt to a glut of capacity and sluggish growth in trade.

Last year Maersk was able to increase its market share as its ships transported 9.4% more containers amidst growth in demand of between 2% and 3%. Freight rates were down by an average of 19% during 2016 said the company.

Get Analysts' Upgrades and Downgrades Daily - Enter your email address below to receive a concise daily summary of analysts' upgrades, downgrades and new coverage with MarketBeat.com's FREE daily email newsletter.