Copenhagen: A.P. Moller-Maersk returned to profit at its main container shipping business in the first quarter, helped by cost cutting and a pick up in volumes, it said on Wednesday.

The Danish company’s Maersk Line plunged to a loss in the last quarter of 2015 for the first time in nearly three years, in an industry battered by a faltering global economy and a glut of vessels available for hire.

Maersk Line made a profit of $37 million in the first three months of 2016, compared with analysts’ average forecast for a loss of $121 million in a Reuters poll.

That was still down from a $714 million profit in the same quarter last year, however.

“While market conditions remain challenging, we continue to adjust our cost base to the new conditions,” Chief Executive Nils Smedegaard said in a statement.

A.P. Moller-Maersk shares jumped more than 5 per cent in early trading.

Maersk reiterated its forecast for its container business to achieve an underlying result this year “significantly below last year”, with global demand for seaborne container transportation expected to grow 1-3 per cent.

Group net profit dropped 86 per cent to $224 million in the first quarter, beating analysts’ average forecast of $55.6 million as the company’s oil division also fared better than expected in weak energy markets.

The oil division made a loss of $29 million, compared with analysts’ average forecast for a $59.5 million loss.

Group revenue fell 19 per cent due to historic low freight rates and weak oil prices.

“This was partly offset by 7 per cent higher container volumes and 15 per cent higher oil entitlement production,” Maersk said.